From 536cb9113436767f0d82a6a32277e80658db1b82 Mon Sep 17 00:00:00 2001 From: Marek Piasecki Date: Thu, 12 Jan 2023 15:04:07 +0100 Subject: [PATCH] offer alternative date if there's no slots --- src/ui/date-input.imba | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/ui/date-input.imba b/src/ui/date-input.imba index fdc46bd..abe4a4e 100644 --- a/src/ui/date-input.imba +++ b/src/ui/date-input.imba @@ -44,7 +44,19 @@ tag date-input - + +let h2 = + incr_altday: do R.write 'alt-date', h.modify("Date", 1, R.param('alt-date')) + decr_altday: do R.write 'alt-date', h.modify("Date", -1, R.param('alt-date')) + +R.setters['alt-date'] = do |v| + let d = R.setters.date(v); + if d + d if d != R.params.date + else R.setters.date(h.today!) + +R.getters['alt-date'] = do |v| if v then R.getters.date(v) else R.param('date') + tag simple-date-input - \ No newline at end of file + \ No newline at end of file