教程 dayjs tutorial

Week of Year (ISO)

获取或设置年份的 ISO 星期。

提示

这依赖 IsoWeek 插件,才能正常运行

javascript
dayjs.extend(isoWeek);

dayjs().isoWeek(); // gets the current ISO week of the year
newDate = dayjs().isoWeek(2); // returns new dayjs object