diff options
author | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-09-26 10:53:40 -0400 |
---|---|---|
committer | Sam X. Chen <sam.xi.chen@gmail.com> | 2019-09-26 10:53:40 -0400 |
commit | 62b72a03c4889377169411c8cdbf372c71cac1af (patch) | |
tree | 5328397ddf7ae571038ffe5d201fb2d77eadf742 /client/lib | |
parent | d5cff1ec48bf9ab13a32576e7495ae54c3d2c0f7 (diff) | |
download | wekan-62b72a03c4889377169411c8cdbf372c71cac1af.tar.gz wekan-62b72a03c4889377169411c8cdbf372c71cac1af.tar.bz2 wekan-62b72a03c4889377169411c8cdbf372c71cac1af.zip |
Add feature: Add due timeline into Calendar view
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), ); |