Opened 11 years ago

Closed 11 years ago

#5923 closed defect (invalid)

Calendar: onChane() returns irregular date format

Reported by: guest Owned by:
Priority: high Milestone:
Component: Dijit Version: 1.1b1
Keywords: Cc:
Blocked By: Blocking:

Description

I'm messing with Digit's Calendar and I don't see why arguments[0] should contain a GMT representation of a date which appears in different order depending on which browser you use. Shouldn't this value be a consistent format for extracting the date to text input such as thedateid below? Output as the MySQL date format would be cool!? YYYY-MM-DD

<input type="text" name="thedate" id="thedateid" size="35"

onfocus="dojo.byId('cal').style.display='block';" >

<span id="cal" style="display:none;">

<input id="calendar1" dojoType="dijit._Calendar"

onchange="myhandler(this.id, arguments[0])" lang="en-us">

</span>

IE 7 on WinXP: arguments[0] = Wed Feb 20 00:00:00 PST 2008

Firefox on WinXP: arguments[0] = Mon Feb 11 2008 00:00:00 GMT-0800 (Pacific Standard Time)

Change History (1)

comment:1 Changed 11 years ago by bill

Resolution: invalid
Status: newclosed
Summary: Digit's Calendar outputs irregular date formatCalendar: onChane() returns irregular date format

onChange()'s argument is a Date object. I guess Date.toString() works differently on different browsers (hence it seems like a bug to you), but if you want to serialize (ie, display) the date in a standard format just use the functions in dojo.date. toIso() or something like that.

Note: See TracTickets for help on using tickets.