其他分享
首页 > 其他分享> > iview时间默认日期结束时间23:59:59

iview时间默认日期结束时间23:59:59

作者:互联网

<FormItem label="时间:">                         <DatePicker type="datetimerange" ref="DatePicker" style="width: 280px" v-model="createDate"                             @on-change="timeChange">                         </DatePicker> </FormItem>   timeChange(time) {                 if (time.length && time[0] && time[1]) {                     // 没有选择时间就默认23:59:59                     if (parseTime(this.createDate[1]).slice(-8) === '00:00:00') {                         this.createDate[1] = new Date(parseTime(time[1], '{y}-{m}-{d}') + ' 23:59:59')                     }                     this.formInline.createDateBegin = parseTime(this.createDate[0]);                     this.formInline.createDateEnd = parseTime(this.createDate[1]);                 } else {                     this.formInline.createDateBegin = '';                     this.formInline.createDateEnd = '';                 }                 this.$refs['DatePicker'].internalValue = this.createDate;             },

标签:00,59,23,createDate,parseTime,time,formInline,iview
来源: https://www.cnblogs.com/wssdx/p/13091964.html