Prism · Time
$dateAdd
Moves a date by an amount of a unit. A negative amount moves it back.
{ createdAt: '2024-01-15T08:30:00Z' }{
$date: {
value: {
$dateAdd: {
date: { $ref: '$.createdAt' },
amount: 30,
unit: 'day',
},
},
format: 'YYYY-MM-DD',
},
}'2024-02-14'
Runs in this page on the installed package. The input and the expected output are defined by the example.