Browse Source

offer alternative date if there's no slots

master
Marek Piasecki 2 years ago
parent
commit
536cb91134
  1. 14
      src/ui/date-input.imba

14
src/ui/date-input.imba

@ -45,6 +45,18 @@ tag date-input
<plus-minus value=R.param('date').getMonth!+1 decorate=h.format decr=h.decr_month incr=h.incr_month>
<plus-minus value=R.param('date').getDate! decorate=h.format decr=h.decr_day incr=h.incr_day>
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
<self>
<plus-minus-v decorate=R.setters.date decr=h.decr_day incr=h.incr_day value=R.param('date')>
<plus-minus-v decorate=R.setters.date decr=h2.decr_altday incr=h2.incr_altday value=R.param('alt-date')>
Loading…
Cancel
Save