date
)2024-05-28T00:00:00Z
and 2024-05-27T16:00:00-0800
are contextually equal. But, JsonLogic equality operator ==
does not know that these are dates and hence, treats them as normal strings and returns a falsy response. To overcome this, it is expected to convert the date_string to date (data type) before applying the equality check.
Input Format: [date_string]
Example-1:
Input:
true
Example-2:
Input:
null
true
duration.between
)duration.between
operator computes the time elapsed between two dates and returns duration as string.
Opertion: duration.between
Return value: ISO 8601 Duration as string
Example:
PT744H
date.add
)null
in case the date or duration string is invalid.
Input Format: [date_string, duration_string]
Example:
2024-05-29T00:00Z
date.sub
)[date_string, duration_string]
Example:
2024-05-27T00:00Z
duration.of
)[interval_to_add,_interval_unit]
Supported Interval Unit: MILLIS
, SECONDS
, MINUTES
, HOURS
, DAYS
, WEEKS
, MONTHS
, YEARS
Example:
P100D
[duration_string, interval_unit]
Supported Interval Unit: MILLIS
, SECONDS
, MINUTES
, HOURS
, DAYS
Example: