Skip to main content

Date Add

A date shifted by an amount of a unit. Months and years CLAMP: 31 January plus one month is 28 February.

Date Add takes a date and produces the date that many units later, recomputing whenever Date, Amount or Unit changes. A negative amount subtracts. Milliseconds through weeks are fixed durations and are exact. Months and years are calendar steps and CLAMP to the end of the target month: 31 January plus one month is 28 February (29 in a leap year), never 2 or 3 March, and 29 February plus one year is 28 February. Both answers are defensible; the classic date bug is not knowing which one you have, so this one is written down. Date accepts a Date, an ISO string or a millisecond timestamp, because a JSON round trip through a Request or Response node turns a date into one of the latter two.

When to use it

Deadlines, trial expiry, renewal dates, 'thirty days from now', 'the same day next month'.

At a glance

CategoryUtilities
Type namenet.noodl.DateAdd
Available inbrowser, cloud
SSR compatibilitysafe
Provided bynoodl-runtime

Inputs

Values

NameTypeDefaultDescription
amountNumber0How much to add. Negative subtracts. Months and years use whole steps
inputDateThe instant to shift. A string or a millisecond timestamp arriving here is read as a date
unitEnum (milliseconds, seconds, minutes, hours, days, weeks, months, years)daysWhat Amount counts. Months and years are calendar steps and CLAMP: 31 January plus one month is 28 (or 29) February, never 2 March

Outputs

Values

NameTypeDefaultDescription
resultDateDate shifted by Amount of Unit, or unset when Date could not be read

Signals

NameTypeDefaultDescription
changedSignalFires after Result has been recomputed, whichever input caused it

Failure outputs

NameTypeDefaultDescription
failureSignalFires when Date could not be read, leaving Result unset

Patterns

  • Now Date → Date Add (+14 days) → Create Record: a trial end date computed on the server.

Watch out for

  • Using Days where Months was meant, to avoid thinking about clamping. 30 days and 1 month are different dates in eleven months of the year.

Now, Date Difference, Date To String

Generated

This page is generated from node-catalog-enriched.json. Do not edit it by hand — run npm run docs:nodes to regenerate, and fix the source enrichment instead.