js 设置某一区间段的时间,作为下拉框选项来用
js 设置某一区间段的时间,作为下拉框选项来用
比如:次日开始为期一周可选(7个选项值依次展示),样式为“2021-02-13”;
function timeFormat(time) { // 时间格式化 2019-09-08
let year = time.getFullYear();
let month = time.getMonth() + 1;
let day = time.getDate();
return year + '-' + month + '-' + day
原创
2021-04-29 17:51:08 ·
518 阅读 ·
0 评论