MCPcopy Create free account
hub / github.com/adobe/react-spectrum / startOfMonth

Function startOfMonth

packages/@internationalized/date/src/queries.ts:170–173  ·  view source on GitHub ↗
(date: DateValue)

Source from the content-addressed store, hash-verified

168export function startOfMonth(date: CalendarDate): CalendarDate;
169export function startOfMonth(date: DateValue): DateValue;
170export function startOfMonth(date: DateValue): DateValue {
171 // Use `subtract` instead of `set` so we don't get constrained in an era.
172 return date.subtract({days: date.day - 1});
173}
174
175/** Returns the last date of the month for the given date. */
176export function endOfMonth(date: ZonedDateTime): ZonedDateTime;

Callers 10

focusSectionStartFunction · 0.90
alignStartFunction · 0.90
Calendar.test.jsFile · 0.90
useWeekAndDayIndicesFunction · 0.90
isSameMonthFunction · 0.85
startOfYearFunction · 0.85
getWeeksInMonthFunction · 0.85
queries.test.jsFile · 0.85

Calls 1

subtractMethod · 0.45

Tested by

no test coverage detected