( date: DateValue, locale: string, firstDayOfWeek?: DayOfWeek )
| 339 | |
| 340 | /** Returns the number of weeks in the given month and locale. */ |
| 341 | export function getWeeksInMonth( |
| 342 | date: DateValue, |
| 343 | locale: string, |
| 344 | firstDayOfWeek?: DayOfWeek |
| 345 | ): number { |
| 346 | let days = date.calendar.getDaysInMonth(date); |
| 347 | return Math.ceil((getDayOfWeek(startOfMonth(date), locale, firstDayOfWeek) + days) / 7); |
| 348 | } |
| 349 | |
| 350 | /** Returns the lesser of the two provider dates. */ |
| 351 | export function minDate<A extends DateValue, B extends DateValue>( |
no test coverage detected