Using VCenter Orchestrator - I have a workflow that will get kicked off via the REST API but the only input option I have from my users POV is a string.
The input from the user should look something like May 9, 2016 2:125:50 PM or similar.
Is there a way for me to format the string/pass a string to the workflow and set the waiting timer object on this input?
Any help would be appreciated.
Thank you.
OK, so you want to get a string value from the user and convert it to a Date object in order to be able to bind it to timer.date attribute of the waiting timer element?
Converting the string to Date can be done easily. Here is some sample code:
var datestr = "May 9, 2016 2:25:50 PM"; // user-provided date string
var dt = new Date(datestr); // parses the string and creates an object of type Date
System.log(dt); // log the Date object value
OK, so you want to get a string value from the user and convert it to a Date object in order to be able to bind it to timer.date attribute of the waiting timer element?
Converting the string to Date can be done easily. Here is some sample code:
var datestr = "May 9, 2016 2:25:50 PM"; // user-provided date string
var dt = new Date(datestr); // parses the string and creates an object of type Date
System.log(dt); // log the Date object value
This worked perfectly. Thank you.