D
devers
I've been try to set a Date Picker control in JScript to the current date.
When I set the node to the results of Date() it is in an invalid format for
any of the option I could find on the date picker control. When I try to
parse out the date to send "YYYY-MM-DD" to the control I get jibberish. I
tried simply modify the sample GetDateDemo funciton that the JScript help
file shows for the GetDate funciton but that did not return the epxected
results either.
I've finally just set the rules on the control to do the work but I am not
sure that it is going to get set properly as the form is part of a workflow
and when the last person completes it I need to set the completed date.
Here's the code I tried, a lsightly modified version of thier code to give
InfoPath the format it said it neexded:
function DateDemo()
{
var d, s ;
d = new Date();
s = d.getYear();
s = s + "-" + (d.getMonth() + 1) + "-";
s = s + d.getDate();
return(s);
}
This returned 0 - the number 0.
Does anyone know how to actually set a date picker to todays date using
JScript in InfoPath?
Thanks!
When I set the node to the results of Date() it is in an invalid format for
any of the option I could find on the date picker control. When I try to
parse out the date to send "YYYY-MM-DD" to the control I get jibberish. I
tried simply modify the sample GetDateDemo funciton that the JScript help
file shows for the GetDate funciton but that did not return the epxected
results either.
I've finally just set the rules on the control to do the work but I am not
sure that it is going to get set properly as the form is part of a workflow
and when the last person completes it I need to set the completed date.
Here's the code I tried, a lsightly modified version of thier code to give
InfoPath the format it said it neexded:
function DateDemo()
{
var d, s ;
d = new Date();
s = d.getYear();
s = s + "-" + (d.getMonth() + 1) + "-";
s = s + d.getDate();
return(s);
}
This returned 0 - the number 0.
Does anyone know how to actually set a date picker to todays date using
JScript in InfoPath?
Thanks!