Help converting Forms Date to Calendar Date-Time
I need help writing a custom Flow function to
convert from the date format of a Form date field:
yyyy-mm-dd
to the
date-time format of a Calendar entry:
yyyy-MM-ddTHH:mm:ssZ
The Calendar
item will be an All-Day event.
It is
acceptable for the Time to be hard-coded to 00:06:00
Please help
with how to format the input into the Flow formatDate() function.
The input to Calendar is:
The error message from Calendar is:
My function is this:
- string formatDate(string dateStr, string fromFormat, string toFormat)
- {
- fromFormat = "yyyy-MM-dd";
- toFormat = " yyyy-MM-ddTHH:mm:ssZ";
- dateObj = dateStr.toTime(fromFormat);
- info dateObj;
- return dateObj.toString(toFormat);
- }