mirror of
https://github.com/tenrok/vue2-datepicker.git
synced 2026-06-23 08:00:36 +03:00
docs: update demo
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<section>
|
<section>
|
||||||
<p>date not before today</p>
|
<p>Not before today && Not after a week</p>
|
||||||
<date-picker v-model="value1" :disabled-date="notBeforeToday"></date-picker>
|
<date-picker v-model="value1" :disabled-date="notBeforeAndAfter"></date-picker>
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<p>date not after today</p>
|
|
||||||
<date-picker v-model="value2" :disabled-date="notAfterToday"></date-picker>
|
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<p>time not before 09:00</p>
|
<p>time not before 09:00</p>
|
||||||
@@ -40,18 +36,15 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value1: new Date(),
|
value1: new Date(),
|
||||||
value2: new Date(),
|
|
||||||
value3: '',
|
value3: '',
|
||||||
value4: '',
|
value4: '',
|
||||||
value5: '',
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
notBeforeToday(date) {
|
notBeforeAndAfter(date) {
|
||||||
return date < today;
|
return (
|
||||||
},
|
date.getTime() < today.getTime() || date.getTime() > today.getTime() + 7 * 24 * 3600 * 1000
|
||||||
notAfterToday(date) {
|
);
|
||||||
return date > today;
|
|
||||||
},
|
},
|
||||||
notBeforeNine(date) {
|
notBeforeNine(date) {
|
||||||
return date.getHours() < 9;
|
return date.getHours() < 9;
|
||||||
|
|||||||
Reference in New Issue
Block a user