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

Function isSameYear

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

Source from the content-addressed store, hash-verified

38 * date.
39 */
40export function isSameYear(a: DateValue, b: DateValue): boolean {
41 b = toCalendar(b, a.calendar);
42 a = startOfYear(a);
43 b = startOfYear(b);
44 return a.era === b.era && a.year === b.year;
45}
46
47/** Returns whether the given dates occur on the same day, and are of the same calendar system. */
48export function isEqualDay(a: DateValue, b: DateValue): boolean {

Callers 3

useCalendarYearPickerFunction · 0.90
isEqualYearFunction · 0.85
queries.test.jsFile · 0.85

Calls 2

toCalendarFunction · 0.90
startOfYearFunction · 0.70

Tested by

no test coverage detected