Tasks
Save Sugartime
The Save Sugartime task allows complex relative dates to be calculated and saved to `stub.data`. This task facilitates the scheduling of events and reminders based on dynamic date calculations.
What is Sugartime?
Sugartime is a date calculation library that allows users to express relative dates in a natural, human-readable format. It's designed to simplify complex date calculations and make them more intuitive.
Basic usage
Save a future reminder date for tomorrow
Parameters
required string
fieldname This is the fieldname to which the data will be written to in stub.data
required string / array
when The relative date to be calculated. This can be any valid SugarTime string. For example, tomorrow at 9am
or next friday at 5pm
This can also be an array of strings. The first item will be used as a starting point, subsequent items will be calculated from that point in time. This is useful for more complex date calculations, ["two weeks from today", "friday at 5pm"]
Result
Properties
fieldname
Name of the field created : reminder_date
savevalue
Caculated date value using the follow datetime format: YYYY-MM-DD HH:mm:ss
2024-01-01 09:00:00
Examples
These are some more complex examples
Save Sugartime using when array
Result
Save Sugartime with custom formatted datetime
Saves fieldname in stub.data
using custom formatted Sugartime date.
Result
Save Sugartime with Heimdall formatted dates
Saves fieldnames in stub.data
for Heimdall formatted Sugartime dates.