您的位置:首页 > 娱乐 > 明星 > 广州网站建设找澳捷_广州市学校安全教育平台官网_星巴克seo网络推广_徐州seo网站推广

广州网站建设找澳捷_广州市学校安全教育平台官网_星巴克seo网络推广_徐州seo网站推广

2024/10/11 22:03:36 来源:https://blog.csdn.net/weixin_45788691/article/details/142758836  浏览:    关键词:广州网站建设找澳捷_广州市学校安全教育平台官网_星巴克seo网络推广_徐州seo网站推广
广州网站建设找澳捷_广州市学校安全教育平台官网_星巴克seo网络推广_徐州seo网站推广

在这里插入图片描述
摘要:

今天遇到需求是配送时间,时隔半个钟的排线!所以需要拼接时间!例如2024-10-08 14:30,2024-10-08 15:00,2024-10-08 15:30
在这里插入图片描述

<el-form-item label="配送时间:" prop="spOrderTime"><el-select v-model="form.spOrderTime" clearable style="width: 240px" @change="changeOrderTime"><!-- <el-option v-for="item in Config.selectTimeOption" :key="item.value" :label="item.label":value="item.value"></el-option> --><el-option v-for="item in Config.selectTimeOption" :key="item.index" :label="item.value":value="item.value"></el-option></el-select>
</el-form-item>
// 获取配送时间数组deliveryTimeList() {const now = dayjs();// 获取当前时间const threeDaysLater = now.add(2, 'day').endOf('day'); //3天后的日期const timePoints = [];//每个半小时整点的时间点let currentTime = now.startOf('hour');// 如果当前时间不是00分或30分,则跳到下一个半小时整点if (currentTime.minute() !== 0 && currentTime.minute() !== 30) {if (currentTime.minute() < 30) {currentTime = currentTime.set('minute', 30);} else {currentTime = currentTime.add(1, 'hour').startOf('hour');}}// 循环生成每个半小时整点的时间点let index=0while (currentTime.isBefore(threeDaysLater) || currentTime.isSame(threeDaysLater)) {timePoints.push({index:index,value:currentTime.format('YYYY-MM-DD HH:mm')});currentTime = currentTime.add(30, 'minute'); index++}// 赋值this.Config.selectTimeOption = timePointsthis.form.spOrderTime=timePoints[0].value},

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com