#921 componete datepicker
This commit is contained in:
parent
48566f647c
commit
34905c616a
|
@ -12,7 +12,7 @@
|
|||
<div class="mdl-chip__action">
|
||||
<i
|
||||
class="material-icons pointer"
|
||||
ng-show="$ctrl.enabled && $ctrl.model && ($ctrl.hasFocus || $ctrl.hasMouseIn)"
|
||||
ng-show="!$ctrl.disabled && $ctrl.model && ($ctrl.hasFocus || $ctrl.hasMouseIn)"
|
||||
ng-click="$ctrl.onClear()">
|
||||
clear
|
||||
</i>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue