yaea04
Newbie
Posts: 1
Registered: 1/23/2006
Member Is Offline
|
| posted on 1/23/2006 at 12:46 AM |
|
|
ISO 8601 standard date format yyyy/mm/dd
I am trying to modify the script to use ISO 8601 standard date format of yyyy/mm/dd or yyyy-mm-dd.
So far, I have successfully modified the script to select a date in that format by changing calendar1.js as shown below:
// date generating function
function cal_gen_date1 (dt_datetime) {
return (
// (dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + "-"
// + (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "-"
// + dt_datetime.getFullYear()
dt_datetime.getFullYear() + "/"
+ (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "/"
+ (dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate()
);
}
However, if the yyyy/mm/dd format is currently in the field, the script says it is invalid.
If anyone has any suggestions, I would greatly appreciate it.
Meanwhile, I will continue.
Many thanks.
|
|
|
tigra
Administrator
Posts: 2050
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 1/23/2006 at 07:28 PM |
|
|
ok, you've modified the function that generates the string from date object, but you should also modify the function that parses the string into the
date object.
|
|
|
oksammyj
Newbie
Posts: 1
Registered: 5/6/2006
Member Is Offline
|
| posted on 5/6/2006 at 06:25 PM |
|
|
yyyy-mm-dd
Could someone please demonstrate how to "modify the function that parses the string into the date object" to produce a yyyy-mm-dd format? That would
be most helpful.
|
|
|