On the BRYTER platform, you can work with dates. In this article, you will learn how to input dates, how to calculate with them and how to output a date in the right format.
Input dates
To input a date, you have various options:
- Ask an end user to input a date with a Date input node.
- Define a date yourself in a Date value node.
- Pick a date in the input field directly.
When choosing a date you can either determine one specific custom date (such as January 1st, 2022) that will be the same for all end users. Alternatively, you can refer to the date of your end user’s interaction, which is the date at which the end user passes through the node. The date of your end user’s interaction will differ between end user sessions.
Calculate with dates
When calculating with dates you can:
- Add or subtract a certain number of days from a date with a Calculate Dates action.
- Calculate the number of days between two dates.
- You can also use the update feature to make the value of a certain date variable depend on end user answers.
Output dates
Usually dates are output through referencing them. You have two options to determine how and what is output:
- When defining the date or calculating with it, you can configure the output format. The most common date formats are available as a pre-defined option, but you can also define your own custom format.
The format D MMMM YYYY outputs your date in the form of 1 January 2022, with the name of the month in the language selected.
- Using the transform options, you can also just output the day, the month, the year, or the day of the week of your date value.
Note that you can also use dates in automatically generated documents and in conditions.