diff --git a/vue-datepicker-1.vue b/vue-datepicker-1.vue index c9d5978..9cedd8e 100644 --- a/vue-datepicker-1.vue +++ b/vue-datepicker-1.vue @@ -560,7 +560,7 @@ exports.default = { this.showDay(next); }, showDay: function showDay(time) { - if (time === undefined || !Date.parse(time)) { + if (time === undefined || !(0, _moment2.default)(time, this.option.format).isValid()) { this.checked.currentMoment = (0, _moment2.default)(); } else { this.checked.currentMoment = (0, _moment2.default)(time, this.option.format); diff --git a/vue-datepicker-es6.vue b/vue-datepicker-es6.vue index 022d0ef..8521ef5 100644 --- a/vue-datepicker-es6.vue +++ b/vue-datepicker-es6.vue @@ -490,7 +490,7 @@ export default { this.showDay(next) }, showDay (time) { - if (time === undefined || !Date.parse(time)) { + if (time === undefined || !moment(time, this.option.format).isValid()) { this.checked.currentMoment = moment() } else { this.checked.currentMoment = moment(time, this.option.format) diff --git a/vue-datepicker.es6-1.vue b/vue-datepicker.es6-1.vue index b7c2248..c95f3a5 100644 --- a/vue-datepicker.es6-1.vue +++ b/vue-datepicker.es6-1.vue @@ -543,7 +543,7 @@ export default { this.showDay(next) }, showDay (time) { - if (time === undefined || !Date.parse(time)) { + if (time === undefined || !moment(time, this.option.format).isValid()) { this.checked.currentMoment = moment() } else { this.checked.currentMoment = moment(time, this.option.format)