summaryrefslogtreecommitdiffstats
path: root/client/lib/datepicker.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-09-28 14:57:00 +0300
committerGitHub <noreply@github.com>2019-09-28 14:57:00 +0300
commited4c49090abfb35ebadc77b40eee4af05ae15ac1 (patch)
tree77b63f462876c411cf1e348bd9cb0934fc505ae8 /client/lib/datepicker.js
parent5696e4a4c67510d8e430eaf4ecb99896f857962e (diff)
parent020b66383643f42c183b758fe1bcb73ac6f689bb (diff)
downloadwekan-ed4c49090abfb35ebadc77b40eee4af05ae15ac1.tar.gz
wekan-ed4c49090abfb35ebadc77b40eee4af05ae15ac1.tar.bz2
wekan-ed4c49090abfb35ebadc77b40eee4af05ae15ac1.zip
Merge pull request #2738 from whowillcare/master
Add feature: Add due timeline into Calendar view
Diffstat (limited to 'client/lib/datepicker.js')
-rw-r--r--client/lib/datepicker.js10
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),
);