时间控件添加星期

qianlishi 3 years ago
parent c047c822cd
commit 1129a8693b

@ -578,6 +578,9 @@ const widgetTools = [
{code: 'MM-dd', name: '日期无年'}, {code: 'MM-dd', name: '日期无年'},
{code: 'hh:mm', name: '时分'}, {code: 'hh:mm', name: '时分'},
{code: 'hh:mm:ss', name: '时分秒'}, {code: 'hh:mm:ss', name: '时分秒'},
{code: 'year-week', name: '日期+星期'},
{code: 'year-h-m-week', name: '日期+时分+星期'},
{code: 'year-h-m-s-week', name: '日期+时分秒+星期'},
{code: 'week', name: '星期'} {code: 'week', name: '星期'}
], ],
value: 'yyyy-MM-dd hh:mm:ss' value: 'yyyy-MM-dd hh:mm:ss'

@ -106,7 +106,39 @@ export default {
dayCycle = "星期" + dayCycleArray[i]; dayCycle = "星期" + dayCycleArray[i];
} }
} }
return dayCycle; if (fmt == "year-week") {
return year + "-" + month + "-" + day + dayCycle;
} else if (fmt == "year-h-m-week") {
return (
year +
"-" +
month +
"-" +
day +
" " +
hours +
":" +
minutes +
dayCycle
);
} else if (fmt == "year-h-m-s-week") {
return (
year +
"-" +
month +
"-" +
day +
" " +
hours +
":" +
minutes +
":" +
seconds +
dayCycle
);
} else if (fmt == "week") {
return dayCycle;
}
}, },
displayTime() { displayTime() {
this.timestr = this.timestr =

Loading…
Cancel
Save