You can now format date and time data that you get from user input types like calendar and date scroller. 

This can be done using a data modifier function called DATETIME_FORMAT Which takes in two parameters:

  1. Date that needs to be formatted.
  2. The Format Snippet.

Here is an example:
{{= this.fns.DATETIME_FORMAT('25 September 2019', 'DD-MM-YY') }

This code returns an output of 25/09/19

If you'd want to format the date by referencing the output of a gambit response,
try this:

{{= this.fns.DATETIME_FORMAT(this.ursp.DateOfBirth, 'DD-MM-YY') }

where ursp.DateOfBirth  gives the "User Response of gambit with name DateOfBirth".

*For this snippet to work the gambit whose response you are trying to refer should be of type date or time.

Using a variation of predefined letters you can build your own format snippet.
Check the image below for all the possible combinations of predefined letters that can be added in the format snippet.

Refer to this page to see what formats you can use:
https://devhints.io/moment#formatting-1


Did this answer your question?