Context API reference
The API property of the context object provides number of convenience methods for generating and manipulating values.
List of methods:
API.timestamp(shift: int, unit: str, now: str = Current_Time) -> str - returns a date in relation to now variable based on the shift and unit values. The function moves the returned value away from now by the shift number of specified units. Supported units: days, weeks, months, years. The value of now defaults to current time if not specified. An example of generating a date referring the same day last week: {context.API.timestamp(-1, 'weeks')}.
API.range(begin: str, end: str, unit: str = 'days') -> [str,str...] - returns list of temporal identifiers based on two dates. Supported units: days, weeks, months, years. Unspecified unit defaults to 'days'. The function returns a list of temporal identifiers based on the unit: 'YYYY-MM-DD' for days, 'YYYY-MM' for months, and 'YYYY-00-WW' for weeks. The result can be used with in expression filter in scenarios where more specific definition of filter is desired:
{context.API.range(context.API.timestamp(-30,'days'),context.API.timestamp(), 'days')}. This example generates list of dates between today and the date 30 days ago.