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

Function addYears

packages/@internationalized/date/src/manipulation.ts:110–116  ·  view source on GitHub ↗
(date: Mutable<AnyCalendarDate>, years: number)

Source from the content-addressed store, hash-verified

108}
109
110function addYears(date: Mutable<AnyCalendarDate>, years: number) {
111 if (date.calendar.isInverseEra?.(date)) {
112 years = -years;
113 }
114
115 date.year += years;
116}
117
118function balanceYearMonth(date: Mutable<AnyCalendarDate>) {
119 while (date.month < 1) {

Callers 2

addFunction · 0.85
balanceYearMonthFunction · 0.85

Calls 1

isInverseEraMethod · 0.65

Tested by

no test coverage detected