IsoWeeksInYear
IsoWeeksInYear 增加了 .isoWeeksInYear()
API 返回一个 number
来得到依据 ISO week 标准一年中有几周
这依赖 IsLeapYear 插件,才能正常运行
javascript
var isoWeeksInYear = require("dayjs/plugin/isoWeeksInYear");
var isLeapYear = require("dayjs/plugin/isLeapYear"); // dependent on isLeapYear plugin
dayjs.extend(isoWeeksInYear);
dayjs.extend(isLeapYear);
dayjs("2004-01-01").isoWeeksInYear(); // 53
dayjs("2005-01-01").isoWeeksInYear(); // 52