# IsoWeeksInYear

URL: https://caijiao.org/dayjs/plugin/iso-weeks-in-year
Source: docs/dayjs/plugin/iso-weeks-in-year.md
Description: IsoWeeksInYear 插件增加了 .isoWeeksInYear() API，它返回一个数字，表示根据 ISO 周标准一年中有多少周。请注意，此插件依赖 IsLeapYear 插件，以确保正确计算闰年。

IsoWeeksInYear 增加了 `.isoWeeksInYear()` API 返回一个 `number` 来得到依据 ISO week 标准一年中有几周

> 这依赖 [IsLeapYear](/dayjs/plugin/is-leap-year) 插件，才能正常运行

```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
```
