Quantcast

decodeDate error using DojoX/Calendar

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

decodeDate error using DojoX/Calendar

Harry Devine

I'm trying to feed a dojoX Calendar data from a store.  The data looks correct coming from the store, but I keep getting the following error in Firebug:  Cannot parse date string (2016-11-12 12:00:00), specify a "decodeDate" function that translates this string into a Date object.


I have a decodeDate function specified.  Here's how I'm creating the calendar:


       var calendar = new Calendar({
         dateInterval: "week",
         startTimeAttr: "begin",
         endTimeAttr: "end",
         store: calendarStore,
         cssClassFunc: function(item) {
           return item.calendar;
         },
         decodeDate: function(s) {
           return stamp.fromISOString(s);
         },
         encodeDate: function(t) {
           return stamp.toISOString(s);
         },
         style: "position:relative; width:500px; height:450px"
       }, "eventsCalendar");


As you can see, I do have a decodeDate function specified.  When I store the date into my database, I stored it as 2016-11-12T12:00:00, yet what is in there is 2016-11-12 12:00:00.  Could this be causing the issue?  If so, how do I correct it?


Thanks,

Harry


--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: decodeDate error using DojoX/Calendar

Harry Devine

Anyone have any ideas????


Harry

On November 6, 2016 at 9:17 AM Harry Devine <[hidden email]> wrote:

I'm trying to feed a dojoX Calendar data from a store.  The data looks correct coming from the store, but I keep getting the following error in Firebug:  Cannot parse date string (2016-11-12 12:00:00), specify a "decodeDate" function that translates this string into a Date object.


I have a decodeDate function specified.  Here's how I'm creating the calendar:


       var calendar = new Calendar({
         dateInterval: "week",
         startTimeAttr: "begin",
         endTimeAttr: "end",
         store: calendarStore,
         cssClassFunc: function(item) {
           return item.calendar;
         },
         decodeDate: function(s) {
           return stamp.fromISOString(s);
         },
         encodeDate: function(t) {
           return stamp.toISOString(s);
         },
         style: "position:relative; width:500px; height:450px"
       }, "eventsCalendar");


As you can see, I do have a decodeDate function specified.  When I store the date into my database, I stored it as 2016-11-12T12:00:00, yet what is in there is 2016-11-12 12:00:00.  Could this be causing the issue?  If so, how do I correct it?


Thanks,

Harry


 

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...