Page 1 of 1

Problem with date format

Posted: Tue Sep 22, 2015 10:17 am
by HelenG
Hello,

I try to change the format of one of my date fields with the code from http://wiki.processmaker.com/index.php/ ... alue.28.29 and it doesn't work.
I don't know where is the mistake...
I appreciate any help.

/*CODE*/
function twoDigits(num) {
return (num < 10 ? "0" : "") + num;
}
function change(){

var d = new Date(getField("start_date").value);
var s = twoDigits(d.getMonth()) + '-' + twoDigits(d.getDate()) + '-' + d.getFullYear();
getField("end_date_of_trial").value = s;
}

leimnud.event.add(getField("start_date"), 'change', change);
/*END_OF_CODE*/


Thanks in advance.

Re: Problem with date format

Posted: Thu May 03, 2018 10:33 am
by cpomares
Hi,
you can change your date format using the "format" property of the datetime control, you can find detailed information about it at the following link:
http://wiki.processmaker.com/3.2/Dateti ... rol#Format

Regards,
Carlos