MCPcopy Create free account
hub / github.com/codemix/graph / getLastDayOfMonth

Function getLastDayOfMonth

packages/graph/src/TemporalTypes.ts:1417–1421  ·  view source on GitHub ↗

* Helper to get the last day of a month.

(year: number, month: number)

Source from the content-addressed store, hash-verified

1415 * Helper to get the last day of a month.
1416 */
1417function getLastDayOfMonth(year: number, month: number): number {
1418 // Month is 1-indexed (1 = January)
1419 // Create date for first day of next month, then go back one day
1420 return new Date(Date.UTC(year, month, 0)).getUTCDate();
1421}
1422
1423/**
1424 * Add months to a date with proper month-end handling.

Callers 1

addMonthsToDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected