Skip to main content

When to use these helpers

Use ISO-like date values where possible and test the expression in the same field, form, or template context where it will run. Formatting is presentation; comparisons and calculations should use the underlying date value.

Calling style

Call a helper as dateFormat($.submitted_at, "YYYY-MM-DD"). Not every helper is available everywhere: validation, form, and document-template helpers have distinct context contracts. Editor suggestions are not proof that a helper is supported at runtime.

Complete function reference

addDays

Adds a specified number of days to a date Signature: addDays(date, days) Example:
Note: It can also be written as a transform when the first value is the input: value | addDays(...).

addHours

Adds a specified number of hours to a date Signature: addHours(date, hours) Example:
Note: It can also be written as a transform when the first value is the input: value | addHours(...).

addMinutes

Adds a specified number of minutes to a date Signature: addMinutes(date, minutes) Example:
Note: It can also be written as a transform when the first value is the input: value | addMinutes(...).

addMonths

Adds a specified number of months to a date Signature: addMonths(date, months) Example:
Note: It can also be written as a transform when the first value is the input: value | addMonths(...).

addYears

Adds a specified number of years to a date Signature: addYears(date, years) Example:
Note: It can also be written as a transform when the first value is the input: value | addYears(...).

date

Constructs a date from components (UTC-normalized wall time) Signature: date(year, month, day, hour?, minute?, second?, millisecond?) Example:
Note: It can also be written as a transform when the first value is the input: value | date(...).

dateAdd

Adds an amount to a date by unit Signature: dateAdd(date, amount, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | dateAdd(...).

dateDiff

Returns the integer difference between two dates in the specified unit Signature: dateDiff(date, other, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | dateDiff(...).

dateFormat

Formats a date using tokens YYYY, MM, DD, HH, mm, ss, SSS (UTC) Signature: dateFormat(date, format) Example:
Note: It can also be written as a transform when the first value is the input: value | dateFormat(...).

dateFromString

Creates a date from a string Signature: dateFromString(str) Example:
Note: It can also be written as a transform when the first value is the input: value | dateFromString(...).

dateFromTime

Creates a date from a time string (hh:mm or hh:mm:ss) Signature: dateFromTime(time) Example:
Note: It can also be written as a transform when the first value is the input: value | dateFromTime(...).

dateFromTimestamp

Creates a date from a numeric timestamp (ms) Signature: dateFromTimestamp(timestamp) Example:
Note: It can also be written as a transform when the first value is the input: value | dateFromTimestamp(...).

dateParse

Parses a date from a tokenized format string Signature: dateParse(str, format) Example:
Note: It can also be written as a transform when the first value is the input: value | dateParse(...).

dateSubtract

Subtracts an amount from a date by unit Signature: dateSubtract(date, amount, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | dateSubtract(...).

day

Returns UTC day of month Signature: day(date) Example:
Note: It can also be written as a transform when the first value is the input: value | day(...).

dayOfYear

Returns the day of the year for a given date Signature: dayOfYear(date) Example:
Note: It can also be written as a transform when the first value is the input: value | dayOfYear(...).

daysInMonth

Returns the number of days in a given month of a year Signature: daysInMonth(year, month) Example:
Note: It can also be written as a transform when the first value is the input: value | daysInMonth(...).

diffDays

Calculates the difference in days between two dates Signature: diffDays(date1, date2) Example:
Note: It can also be written as a transform when the first value is the input: value | diffDays(...).

diffHours

Calculates the difference in hours between two dates Signature: diffHours(date1, date2) Example:
Note: It can also be written as a transform when the first value is the input: value | diffHours(...).

diffMinutes

Calculates the difference in minutes between two dates Signature: diffMinutes(date1, date2) Example:
Note: It can also be written as a transform when the first value is the input: value | diffMinutes(...).

endOfDay

Returns the end of the day for a given date Signature: endOfDay(date) Example:
Note: It can also be written as a transform when the first value is the input: value | endOfDay(...).

endOfMonth

Returns the end of the month for a given date Signature: endOfMonth(date) Example:
Note: It can also be written as a transform when the first value is the input: value | endOfMonth(...).

endOfWeek

Returns the end of the week for a given date Signature: endOfWeek(date) Example:
Note: It can also be written as a transform when the first value is the input: value | endOfWeek(...).

endOfYear

Returns the end of the year for a given date Signature: endOfYear(date) Example:
Note: It can also be written as a transform when the first value is the input: value | endOfYear(...).

formatDateTime

Formats a date and time together Signature: formatDateTime(date, dateStyle?, timeStyle?, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatDateTime(...).

formatFull

Formats a date as a full date string Signature: formatFull(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatFull(...).

formatLong

Formats a date as a long date string Signature: formatLong(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatLong(...).

formatMedium

Formats a date as a medium date string Signature: formatMedium(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatMedium(...).

formatShort

Formats a date as a short date string Signature: formatShort(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatShort(...).

formatTimeLong

Formats a date as a long time string Signature: formatTimeLong(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatTimeLong(...).

formatTimeMedium

Formats a date as a medium time string Signature: formatTimeMedium(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatTimeMedium(...).

formatTimeShort

Formats a date as a short time string Signature: formatTimeShort(date, locale?) Example:
Note: It can also be written as a transform when the first value is the input: value | formatTimeShort(...).

getAge

Calculates the age in years from a given date Signature: getAge(birthDate) Example:
Note: It can also be written as a transform when the first value is the input: value | getAge(...).

hour

Returns UTC hour Signature: hour(date) Example:
Note: It can also be written as a transform when the first value is the input: value | hour(...).

isAfter

Checks if a date is after another by unit Signature: isAfter(date, other, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | isAfter(...).

isBefore

Checks if a date is before another by unit Signature: isBefore(date, other, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | isBefore(...).

isLeapYear

Checks if a given year is a leap year Signature: isLeapYear(year) Example:
Note: It can also be written as a transform when the first value is the input: value | isLeapYear(...).

isSame

Checks if two dates are the same by unit Signature: isSame(date, other, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | isSame(...).

isSameDay

Checks if two dates fall on the same calendar day Signature: isSameDay(date1, date2) Example:
Note: It can also be written as a transform when the first value is the input: value | isSameDay(...).

isSameOrAfter

Checks if a date is the same or after another by unit Signature: isSameOrAfter(date, other, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | isSameOrAfter(...).

isSameOrBefore

Checks if a date is the same or before another by unit Signature: isSameOrBefore(date, other, unit) Example:
Note: It can also be written as a transform when the first value is the input: value | isSameOrBefore(...).

isToday

Checks if a given date is today Signature: isToday(date) Example:
Note: It can also be written as a transform when the first value is the input: value | isToday(...).

isTomorrow

Checks if a given date is tomorrow Signature: isTomorrow(date) Example:
Note: It can also be written as a transform when the first value is the input: value | isTomorrow(...).

isValidDatePattern

Validates if a date string matches supported patterns Signature: isValidDatePattern(dateString) Example:
Note: It can also be written as a transform when the first value is the input: value | isValidDatePattern(...).

isYesterday

Checks if a given date is yesterday Signature: isYesterday(date) Example:
Note: It can also be written as a transform when the first value is the input: value | isYesterday(...).

millisecond

Returns UTC millisecond Signature: millisecond(date) Example:
Note: It can also be written as a transform when the first value is the input: value | millisecond(...).

minute

Returns UTC minute Signature: minute(date) Example:
Note: It can also be written as a transform when the first value is the input: value | minute(...).

month

Returns UTC month (1-12) Signature: month(date) Example:
Note: It can also be written as a transform when the first value is the input: value | month(...).

normalizeDateInput

Runs the registered date helper named normalizeDateInput. Signature: normalizeDateInput(value) Example:
Note: It can also be written as a transform when the first value is the input: value | normalizeDateInput(...).

now

Returns the current Date at evaluation time. In a document template, now() is supplied by the render helper; use the stable $now context value when every section needs one captured timestamp. Signature: now() Example:
Availability: General helper. It is time-dependent; do not use it for a deterministic serial namespace or a persisted result without a refresh policy. Note: It can also be written as a transform when the first value is the input: value | now(...).

parseDateString

Validates and parses a date string to a Date or null Signature: parseDateString(dateString) Example:
Note: It can also be written as a transform when the first value is the input: value | parseDateString(...).

parseIsoDate

Parses an ISO date string into a date object Signature: parseIsoDate(isoDate) Example:
Note: It can also be written as a transform when the first value is the input: value | parseIsoDate(...).

second

Returns UTC second Signature: second(date) Example:
Note: It can also be written as a transform when the first value is the input: value | second(...).

startOfDay

Returns the start of the day for a given date Signature: startOfDay(date) Example:
Note: It can also be written as a transform when the first value is the input: value | startOfDay(...).

startOfMonth

Returns the start of the month for a given date Signature: startOfMonth(date) Example:
Note: It can also be written as a transform when the first value is the input: value | startOfMonth(...).

startOfWeek

Returns the start of the week for a given date Signature: startOfWeek(date) Example:
Note: It can also be written as a transform when the first value is the input: value | startOfWeek(...).

startOfYear

Returns the start of the year for a given date Signature: startOfYear(date) Example:
Note: It can also be written as a transform when the first value is the input: value | startOfYear(...).

subtractDays

Subtracts a specified number of days from a date Signature: subtractDays(date, days) Example:
Note: It can also be written as a transform when the first value is the input: value | subtractDays(...).

subtractMonths

Subtracts a specified number of months from a date Signature: subtractMonths(date, months) Example:
Note: It can also be written as a transform when the first value is the input: value | subtractMonths(...).

subtractYears

Subtracts a specified number of years from a date Signature: subtractYears(date, years) Example:
Note: It can also be written as a transform when the first value is the input: value | subtractYears(...).

timestamp

Returns milliseconds since epoch Signature: timestamp(date) Example:
Note: It can also be written as a transform when the first value is the input: value | timestamp(...).

toIsoDate

Converts a date object to an ISO date string Signature: toIsoDate(date) Example:
Note: It can also be written as a transform when the first value is the input: value | toIsoDate(...).

weekOfYear

Returns the week number of the year for a given date Signature: weekOfYear(date) Example:
Note: It can also be written as a transform when the first value is the input: value | weekOfYear(...).

year

Returns UTC full year Signature: year(date) Example:
Note: It can also be written as a transform when the first value is the input: value | year(...).

Before you publish

  • Start with a known value and confirm the expected result.
  • Handle null, empty text, and empty lists deliberately.
  • Do not place secrets, access tokens, or sensitive personal data in an expression.
  • Read expression contexts and availability before copying an expression between features.
Date and time helpers in KayanOS