diff options
Diffstat (limited to 'client/lib')
-rw-r--r-- | client/lib/datepicker.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/lib/datepicker.js b/client/lib/datepicker.js index eb5b60b8..da44bbc5 100644 --- a/client/lib/datepicker.js +++ b/client/lib/datepicker.js @@ -21,7 +21,15 @@ DatePicker = BlazeComponent.extendComponent({ function(evt) { this.find('#date').value = moment(evt.date).format('L'); this.error.set(''); - this.find('#time').focus(); + const timeInput = this.find('#time'); + timeInput.focus(); + if (!timeInput.value) { + const currentHour = evt.date.getHours(); + const defaultMoment = moment( + currentHour > 0 ? evt.date : '1970-01-01 08:00:00', + ); // default to 8:00 am local time + timeInput.value = defaultMoment.format('LT'); + } }.bind(this), ); |