From 34905c616add738fdc600b4ef340d3efcd7dc26d Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 21 Dec 2018 14:14:46 +0100 Subject: [PATCH] #921 componete datepicker --- .../core/src/components/date-picker/date-picker.html | 2 +- client/core/src/components/date-picker/date-picker.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/core/src/components/date-picker/date-picker.html b/client/core/src/components/date-picker/date-picker.html index f0519c48a..67fcd880b 100644 --- a/client/core/src/components/date-picker/date-picker.html +++ b/client/core/src/components/date-picker/date-picker.html @@ -12,7 +12,7 @@
clear diff --git a/client/core/src/components/date-picker/date-picker.js b/client/core/src/components/date-picker/date-picker.js index d4b1bf25c..63f590c04 100644 --- a/client/core/src/components/date-picker/date-picker.js +++ b/client/core/src/components/date-picker/date-picker.js @@ -29,7 +29,7 @@ class DatePicker extends Component { if (this.vp.selectedDates.length) { let date = this.vp.selectedDates[0]; - if (!this.isLocale && !this._iniOptions.enableTime) { + if (!this.isLocale && !this._iniOptions.enableTime && !this.iniOptions.onlyDate) { let now = new Date(); date.setTime(date.getTime() + now.getHours() * 60 * 60 * 1000 @@ -38,7 +38,15 @@ class DatePicker extends Component { + now.getUTCMilliseconds() ); } + console.log(this.iniOptions); + if (this.iniOptions.onlyDate) { + let now = new Date(); + let offset = now.getTimezoneOffset() * 60000; + date.setHours(0, 0, 0, 0); + date.setTime(date.getTime() - offset); + } + console.log(date); this._model = date; } else this.model = null;