Skip to main content
Version: ACE 5

Date Functions

Overview

Date Functions allows you to manipulate with date objects by adding or subtracting time as well as changing date format.

Configuration

  • Source path (maps[].sourcePath) - the doc node from which to take input date
  • Action (maps[].action) - action to execute on date object - can be either add,subtract or startOf
  • Amount (maps[].amount) - amount by which to modify date (integer)
  • Amount type (maps[].amountType) - milliseconds, seconds, minutes, hours, days, weeks, months or years
  • Format (maps[].format) - format in which to return the date
  • Target path (maps[].targetPath) - the doc node on which to set the resulting date
  • Append (maps[].append) - 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

InputValue
sourcePathdate
actionadd
amount10
amount typeyears
formatYYYY-MM-DD
target pathresult
appendno

Result

{
"doc": {
"date": "2021-10-08T17:25:39.439Z",
"result": "2031-10-08"
},
"errors": []
}

Example flow

Sample Date Functions Flow
tags: []
steps:
- stepType: date
config:
maps:
- manipulate:
action: add
amountType: years
amount: 10
format: YYYY-MM-DD
sourcePath: date
targetPath: result
name: Date Functions
description: ""
condition: ""
sampleData:
date: 2021-10-08T17:25:39.439Z