File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -379,9 +379,21 @@ export default {
379
379
openDate () {
380
380
this .setPageDate ()
381
381
},
382
- value (value ) {
383
- const parsedValue = this .parseValue (value)
384
- this .setValue (parsedValue)
382
+ value: {
383
+ handler (newValue , oldValue ) {
384
+ let parsedValue = this .parseValue (newValue)
385
+ const oldParsedValue = this .parseValue (oldValue)
386
+
387
+ if (! this .utils .compareDates (parsedValue, oldParsedValue)) {
388
+ const isDateDisabled = parsedValue && this .isDateDisabled (parsedValue)
389
+
390
+ if (isDateDisabled) {
391
+ parsedValue = null
392
+ }
393
+ this .setValue (parsedValue)
394
+ }
395
+ },
396
+ immediate: true ,
385
397
},
386
398
view (newView , oldView ) {
387
399
this .handleViewChange (newView, oldView)
@@ -605,18 +617,7 @@ export default {
605
617
/**
606
618
* Initiate the component
607
619
*/
608
- // eslint-disable-next-line complexity,max-statements
609
620
init () {
610
- if (this .value ) {
611
- let parsedValue = this .parseValue (this .value )
612
- const isDateDisabled = parsedValue && this .isDateDisabled (parsedValue)
613
-
614
- if (isDateDisabled) {
615
- parsedValue = null
616
- }
617
- this .setValue (parsedValue)
618
- }
619
-
620
621
if (this .typeable ) {
621
622
this .latestValidTypedDate = this .selectedDate || this .computedOpenDate
622
623
}
You can’t perform that action at this time.
0 commit comments