Commit 6d3bc51d authored by 童皓's avatar 童皓

Update u-calendar.vue

parent 7b1f2f03
...@@ -289,13 +289,9 @@ ...@@ -289,13 +289,9 @@
init() { init() {
let now = new Date(); let now = new Date();
let minDate = new Date(this.minDate); let minDate = new Date(this.minDate);
if (now < minDate) {
now = minDate;
}
let maxDate = new Date(this.maxDate); let maxDate = new Date(this.maxDate);
if (now > maxDate) { if (now < minDate) now = minDate;
now = maxDate; if (now > maxDate) now = maxDate;
}
this.year = now.getFullYear(); this.year = now.getFullYear();
this.month = now.getMonth() + 1; this.month = now.getMonth() + 1;
this.day = now.getDate(); this.day = now.getDate();
...@@ -644,4 +640,4 @@ ...@@ -644,4 +640,4 @@
} }
} }
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment