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

Function isSameMonth

packages/@internationalized/date/src/queries.ts:28–34  ·  view source on GitHub ↗
(a: DateValue, b: DateValue)

Source from the content-addressed store, hash-verified

26 * date.
27 */
28export function isSameMonth(a: DateValue, b: DateValue): boolean {
29 b = toCalendar(b, a.calendar);
30 // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.
31 a = startOfMonth(a);
32 b = startOfMonth(b);
33 return a.era === b.era && a.year === b.year && a.month === b.month;
34}
35
36/**
37 * Returns whether the given dates occur in the same year, using the calendar system of the first

Callers 4

Calendar.tsxFile · 0.90
CalendarCellFunction · 0.90
isEqualMonthFunction · 0.85
queries.test.jsFile · 0.85

Calls 2

toCalendarFunction · 0.90
startOfMonthFunction · 0.85

Tested by

no test coverage detected