Skip to content

plain/calculate

  • addBusinessDays: Return a PlainDate ISO string with amount working days added to value.
  • addDate: Return a PlainDate ISO string with amount added according to units.
  • addDateTime: Return a PlainDateTime ISO string with units added to value.
  • addTime: Return a PlainTime ISO string with units added to value.
  • clampDate: Restrict value to the range [min, max].
  • closestDateTo: Return the candidate date nearest to target by calendar distance.
  • cycleDate: Return a PlainDate ISO string with field cycled by amount, wrapping at that field’s own min/max instead of carrying into the next larger field.
  • cycleDateTime: Return a PlainDateTime ISO string with field cycled by amount, wrapping at that field’s own min/max instead of carrying into the next larger field.
  • cycleTime: Return a PlainTime ISO string with field cycled by amount, wrapping at that field’s own min/max instead of carrying into the next larger field (hour 23 +1 wraps to 0, it never changes a date — cycleTime has no date component to carry into in the first place).
  • diffDate: Return the difference between two PlainDate values using the provided unit.
  • diffDateAsDuration: Return the difference between two PlainDate values as an ISO 8601 duration string, bridging to the duration namespace (see parseDuration, normalizeDuration).
  • diffDateTime: Return the difference between two PlainDateTime values in the requested unit.
  • diffDateTimeAsDuration: Return the difference between two PlainDateTime values as an ISO 8601 duration string, bridging to the duration namespace (see parseDuration, normalizeDuration).
  • diffTime: Return the difference between two PlainTime values in the requested unit.
  • endOfDate: Return the end of the specified date unit for a given ISO 8601 date string.
  • endOfDateTime: Return the end of the specified date-time unit for a given ISO 8601 datetime string.
  • endOfQuarterForDate: Return the last day of the quarter for a given ISO date.
  • endOfQuarterForDateTime: Return the end of the quarter for a given ISO datetime.
  • endOfTime: Return the end of the specified time unit for a given ISO 8601 time string.
  • getDayOfYear: Return the ordinal day-of-year (1-based) for value.
  • getDaysInMonth: Return the number of days in the month containing value.
  • getDaysInYear: Return the number of days in the calendar year containing value.
  • getLargestDateDurationUnit: Return the largest DateDurationUnit from the provided array.
  • getLargestDateTimeDurationUnit: Return the largest DateTimeDurationUnit from the provided array.
  • getLargestTimeDurationUnit: Return the largest TimeDurationUnit from the provided array.
  • getLocaleDayOfWeek: Return the locale-relative day-of-week index for value.
  • getLocaleEndOfWeek: Return the end of the week containing value, using locale’s first day of week (e.g. en-US: week ends Saturday, fr-FR: week ends Sunday).
  • getLocaleStartOfWeek: Return the start of the week containing value, using locale’s first day of week (e.g. en-US: Sunday, fr-FR: Monday).
  • getLocaleWeekYear: Return the locale-relative week-numbering year value belongs to, from locale’s first day of week and a minimal-days-in-first-week rule.
  • getQuarterForDate: Return the quarter of the year (1-4) for a given ISO date.
  • getQuarterForDateTime: Return the quarter of the year (1-4) for a given ISO datetime.
  • getWeekNumber: Calculate the week number based on configurable week start day.
  • getWeekOfMonth: Return the 1-based row value falls on within its month’s calendar grid, using locale’s first day of week.
  • getWeeksInLocaleWeekYear: Return the number of weeks (52 or 53) in the locale week-numbering year containing value, from locale’s first day of week and a minimal-days-in-first-week rule.
  • getWeeksInMonth: Return the number of calendar-grid rows (4, 5, or 6) value’s month spans, using locale’s first day of week.
  • getWeeksInYear: Return the number of ISO weeks (52 or 53) in the ISO week-numbering year containing value.
  • getWeekYear: Return the ISO 8601 week-numbering year value belongs to.
  • maxDate: Return the latest (maximum) of the given PlainDate values.
  • maxDateTime: Return the latest (maximum) of the given PlainDateTime values.
  • maxTime: Return the latest (maximum) of the given PlainTime values.
  • minDate: Return the earliest (minimum) of the given PlainDate values.
  • minDateTime: Return the earliest (minimum) of the given PlainDateTime values.
  • minTime: Return the earliest (minimum) of the given PlainTime values.
  • nextWeekday: Return a PlainDate ISO string for the next occurrence of dayOfWeek on or after value.
  • previousWeekday: Return a PlainDate ISO string for the previous occurrence of dayOfWeek on or before value.
  • roundDate: Round an ISO 8601 date string to the specified date unit.
  • roundDateTime: Round an ISO 8601 datetime string to the specified date-time unit.
  • roundTime: Round an ISO 8601 time string to the specified time unit.
  • setDate: Return a PlainDate ISO string with the given fields set on value.
  • setDateTime: Return a PlainDateTime ISO string with the given fields set on value.
  • setTime: Return a PlainTime ISO string with the given fields set on value.
  • sortDates: Sort an array of PlainDate values in ascending or descending order.
  • sortDateTimes: Sort an array of PlainDateTime values in ascending or descending order.
  • sortTimes: Sort an array of PlainTime values in ascending or descending order.
  • startOfDate: Return the start of the specified date unit for a given ISO 8601 date string.
  • startOfDateTime: Return the start of the specified date-time unit for a given ISO 8601 datetime string.
  • startOfQuarterForDate: Return the first day of the quarter for a given ISO date.
  • startOfQuarterForDateTime: Return the start of the quarter for a given ISO datetime.
  • startOfTime: Return the start of the specified time unit for a given ISO 8601 time string.
  • subtractBusinessDays: Return a PlainDate ISO string with amount working days subtracted from value.
  • subtractDate: Return a PlainDate ISO string with units subtracted from value.
  • subtractDateTime: Return a PlainDateTime ISO string with units subtracted from value.
  • subtractTime: Return a PlainTime ISO string with units subtracted from value.
  • weekOfYearForDate: Return the ISO week number for a given ISO 8601 date string.
  • weekOfYearForDateTime: Return the ISO week number for a given ISO 8601 datetime string.
  • EndOfTimeUnit: Units endOfTime accepts: a Temporal time unit, or "day" for the last moment of the day, each singular or plural.
  • StartOfTimeUnit: Units startOfTime accepts: a Temporal time unit, or "day" for midnight, each singular or plural.