• Shift a date by a whole number of days, rolling months and years over correctly. Because a day is a constant number of seconds, this is exact arithmetic on the linear worldTime value — the calendar's own decomposition handles every month/year boundary (including variable-length months and intercalary days).

    Parameters

    • calendar: SohlCalendarData

      The active calendar.

    • parts: DateParts

      The starting date parts (time of day is preserved).

    • nDays: number

      Days to add (negative to go backward).

    Returns DateParts | null

    The shifted parts, or null if parts is not a valid date.