VMware Cloud Community
ghman
Enthusiast
Enthusiast
Jump to solution

Orchestrator Waiting Timer Date Time String

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

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

View solution in original post

Reply
0 Kudos
2 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

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

Reply
0 Kudos
ghman
Enthusiast
Enthusiast
Jump to solution

This worked perfectly. Thank you.

Reply
0 Kudos