Convert User Input to YYYY-MM-DD Date Format

This workflow requests a date input from the user (in various formats) or a step of days starting from the current date. The input will then be converted into the designated target date using the pattern YYYY-MM-DD, which is the default format for Helmut4.

We begin with a Helmut4 Input Action, asking for a date or a date step:

The input is then passed into a JavaScript Action node, where an additional temporary variable is defined to set a maximum number of steps, ensuring that the user can't input a date like August 3rd, 2045.

The node will return either the calculated date or an error message.

The only limitation is with input formats: "dd MM yyyy" and "MM dd yyyy" would be interpreted incorrectly. Therefore, only the US format, "MM/dd/yyyy," is accepted.

However, the code can be adjusted to meet your specific format requirements.

Last updated