I am trying to figure out how I can either prevent someone from rerunning a workflow or force a date object to update even if the workflow is rerun. I am using a data binding in my presentation to bind my date to the #__datetime. This works fine unless someone reruns the workflow. Thanks
No pain at all
var dt = new Date();
System.log("Current date and time: " + dt);
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date
Well, the whole idea of re-running a workflow execution is to be able to restore the same input parameters' values.
If you want your date to always be equal to the current date (even during re-run), is it an option to not expose it as an input parameter at all, but instead obtain the current date where it is used in your scripting code (eg. by calling new Date())?
Yes that is something I considered but getting the current date and time in javascript looks like it will be a pain. Is there a way to get the #__datetime from javascript or is there another way to get the current date and time?
No pain at all
var dt = new Date();
System.log("Current date and time: " + dt);
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date
That is cool. I did not realize new Date() created a date object that is set to the current date. That is much better than what I was thinking I had to do. Thanks