Date Functions
Overview
Date Functions
allows you to manipulate with date objects by adding or subtracting time as well as changing date format.
Configuration
sourcePath
- thedoc
node from which to take input dateaction
- action to execute on date object - can be eitheradd
,subtract
orstartOf
amount
- amount by which to modify date (integer)amount type
-milliseconds
,seconds
,minutes
,hours
,days
,weeks
,months
oryears
format
- format in which to return the datetarget path
- thedoc
node on which to set the resulting dateappend
- if checked will create an array on target path and push the value to it
note
It is possible to do multiple date manipulations by adding multiple rules
Examples
Input
{
"date": "2021-10-08T17:25:39.439Z"
}
Step configuration
Input | Value |
---|---|
sourcePath | date |
action | add |
amount | 10 |
amount type | years |
format | YYYY-MM-DD |
target path | result |
append | no |
Result
{
"doc": {
"date": "2021-10-08T17:25:39.439Z",
"result": "2031-10-08"
},
"errors": []
}
Example flow
Sample Date Functions Flow
{
"name": "exampleDateFunctions",
"flow": {
"name": "exampleDateFunctions",
"description": "",
"steps": [
{
"stepType": "date",
"color": "rgb(223,204,241)",
"displayName": "Date Functions",
"isSelected": true,
"config": {
"maps": [
{
"manipulate": {
"action": "add",
"amountType": "years",
"amount": 10
},
"format": "YYYY-MM-DD",
"sourcePath": "date",
"targetPath": "result"
}
]
}
}
]
},
"inputSchema": {
"date": "2021-10-08T17:25:39.439Z"
},
"createDate": "2021-10-08T17:14:14.564Z",
"id": 1633713254700
}