Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In a normal query you might search for those resources with endDate >= "2021-03-19". At time of writing this is the current date. However if a specific date like this is saved in the widget config then by the next day, it will not longer be the current date. To that end, if the user wishes the widget to display data based on a variable date then a token such as {{currentDate}} can be used. This is saved to the backend as a string, and then when parsing this back ready to perform a fetch it will be translated to the current date. There is also have a syntax for adding or subtracting days, weeks, months or even years from the current date as a variable:  {{currentDate#4#w}} would be four weeks from "today", {{currentDate#-2#d}} would represent 2 days ago (The 'd' is actually assumed in its absence). The controls are:

  • 'd': day
  • 'w': week
  • 'mM': month
  • 'y': year


This is all handled in the frontend through a single form component so the user won't need to worry about the syntax. (See below). Likewise there is a {{currentUser}} token to represent the current user.

...