# getWeekOfMonth

URL: https://caijiao.org/date-fns/week/getWeekOfMonth
Source: docs/date-fns/week/getWeekOfMonth.md
Description: 返回给定日期所在月份的周数。

返回给定日期所在月份的周数。

```javascript
import { getWeekOfMonth } from "date-fns";

// 示例日期
const date = new Date(2024, 4, 15); // 2024年5月15日

// 获取给定日期所在月份的周数
const weekOfMonth = getWeekOfMonth(date);

console.log("给定日期所在月份的周数：", weekOfMonth);
// 给定日期所在月份的周数：3
```
