[Date] Date Functions

This recipe demonstrates the use of various Date functions in a report template.

Major steps include the following:

  1. Create a report template (DateFunctions.rml) using the datasource (Copy of Employee.ds).
  2. Standard JavaScript utilities can be easily referenced, which includes Formatting and Date Functions.
  • function offsetDays(origDate, numDays)
  • function offsetMonths(origDate, numMonths)
  • function offsetYears(origDate, numYears)
  • function offsetDate(origDate, numYears, numMonths, numDays)
  • function dateDiff(DateA, DateB, interval)

To download the necessary files for this recipe, refer to the attached ZIP package.
DateFunctions.zip (5.7 KB)