@@ -250,6 +250,11 @@ export default {
250
250
calendarHeight: 0 ,
251
251
calendarSlots,
252
252
isClickOutside: false ,
253
+ /*
254
+ * The latest valid `typedDate` (used for typeable datepicker)
255
+ * {Date}
256
+ */
257
+ latestValidTypedDate: null ,
253
258
/*
254
259
* Vue cannot observe changes to a Date Object so date must be stored as a timestamp
255
260
* This represents the first day of the current viewing month
@@ -527,6 +532,7 @@ export default {
527
532
/**
528
533
* Initiate the component
529
534
*/
535
+ // eslint-disable-next-line complexity,max-statements
530
536
init () {
531
537
if (this .value ) {
532
538
let parsedValue = this .parseValue (this .value )
@@ -537,6 +543,8 @@ export default {
537
543
this .$emit (' input' , parsedValue)
538
544
}
539
545
this .setValue (parsedValue)
546
+ } else if (this .typeable ) {
547
+ this .latestValidTypedDate = this .utils .getNewDateObject ()
540
548
}
541
549
542
550
if (this .isInline ) {
@@ -669,17 +677,23 @@ export default {
669
677
this .slideDuration = parseFloat (durationInSecs) * 1000
670
678
},
671
679
/**
672
- * Set the datepicker value
680
+ * Set the datepicker value (and, if typeable, update `latestValidTypedDate`)
673
681
* @param {Date|String|Number|null} date
674
682
*/
675
683
setValue (date ) {
676
684
if (! date) {
677
685
this .selectedDate = null
678
686
this .setPageDate ()
687
+ if (this .typeable ) {
688
+ this .latestValidTypedDate = this .computedOpenDate
689
+ }
679
690
return
680
691
}
681
692
this .selectedDate = date
682
693
this .setPageDate (date)
694
+ if (this .typeable ) {
695
+ this .latestValidTypedDate = date
696
+ }
683
697
},
684
698
/**
685
699
* Set the picker view
0 commit comments