feat:增加WEEKDAY和WEEK表达式

This commit is contained in:
lvxiaojiao 2023-02-27 21:05:14 +08:00
parent 887dbfd130
commit b2b81fc6e6

View File

@ -1516,12 +1516,7 @@ export class Evaluator {
*/
fnWEEKDAY(date: Date | string | number, type?: number) {
const md = moment(this.normalizeDate(date));
if (type === 1) {
return md.weekday();
} else if (type === 2) {
return md.isoWeekday();
}
return md.weekday();
return !type || type === 1 ? md.weekday() : md.isoWeekday();
}
/**