mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
feat:增加WEEKDAY和WEEK表达式
This commit is contained in:
parent
887dbfd130
commit
b2b81fc6e6
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user