Dojo and Dijit process Dates at local time, not GMT, which in itself could be a poor design choice, but on the condition that if you use dojo.date.stamp.fromISOString() or pass the string "2010-04-02" as the value in your HTML, you get April 2 at midnight in your local time. Pass it on to Digit and he will be happy. Using the new ES5 date constructor in Javascript will have different results:
(I'm in the eastern time zone)
>>> new Date("2010-04-02") Thu Apr 01 2010 20:00:00 GMT-0400 (EST) {}
which defines the date in GMT. However, the following object will work as expected with Dijit:
>>> new Date(2010, 3, 2) Fri Apr 02 2010 00:00:00 GMT-0400 (EST) {}
Also, the Javascript new Date constructor is poorly defined when it comes to accepting strings. I am not sure that the result you get is consistent across all browsers. It is recommended that you use dojo.date.stamp.fromISOString("2010-04-02") to obtain the appropriate Date object or ES5 ISO date methods, if available in new browsers.
source share