<FormItemlabel=""> <Row> <Colspan= "One"> <DatePickertype= "Date": Options= "Starttimeoptions"@on-change= "Starttimechange"placeholder= "Start Time"V-model= "StartTime"></DatePicker> </Col> <Colspan= "2"style= "Text-align:center">-</Col> <Colspan= "One"> <DatePickertype= "Date": Options= "Endtimeoptions"@on-change= "Endtimechange"placeholder= "End Time"V-model= "Endtime"></DatePicker> </Col> </Row></FormItem>
Exportdefault{data () {return{starttimeoptions: {},//Start Date SettingEndtimeoptions: {},//End Date SettingStartTime: ",//Start date ModelEndtime: ",//End Date Model}}, methods: {starttimechange:function(e) {//Set start time This. starttime =e; This. endtimeoptions ={disableddate:date={Let startTime= This. starttime?NewDate ( This. starttime). ValueOf (): "; returnDate && (date.valueof () <startTime); }}, Endtimechange:function(e) {//Set End Time This. Endtime =e; Let EndTime= This. endtime?NewDate ( This. Endtime). ValueOf ()-1 * 24 * 60 * 60 * 1000: '; This. starttimeoptions ={disableddate (date) {returnDate && date.valueof () >EndTime; } } }, }}
Vue iview Time Component DatePicker, set start time and end time constraints