IsoWeeksInYear
IsoWeeksInYear 添加了 .isoWeeksInYear()
API 以返回 number
,以根据 ISO 周获取一年中的周数。
This requires the
IsLeapYear
plugin to work
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