Friday, 15 March 2013

javascript - jQuery Fullcalendar not rendering events in IE -



javascript - jQuery Fullcalendar not rendering events in IE -

just title says, not rendering events on version of ie.

using ie 7 10 , none of versions renders event. jquery 1.11.0 , fullcalendar 1.6.4.

if manually set in events works perfectly, events fetch ajax phone call not display events @ all, other browsers display them no problem.

i events ajax phone call parse array of json objects. raw info received phone call looks this:

[ [ { "start": "2014,05,01", "title": "event test 2", "content": "avec du texte pour en mettre plus", "id": 153 } ], [ { "start": "2014,04,16", "title": "event test", "content": "<p>du texte pour le premier événement.</p>", "id": 118 } ], [ { "start": "2014,04,10", "title": "event test", "content": "<p>du texte pour le premier événement.</p>", "id": 118 } ] ]

after loop in 2 dimension array fetch each individual object , force array, code is:

for(var = 0; < jsondata.length; i++){ for(var k = 0; k < jsondata[i].length; k++){ dataevents.push(jsondata[i][k]); } }

now if hardcode array of above mentioned json objects manually events property of fullcalendar works, why not work when array created loop?

ie shows no errors, no file not beingness loaded (or loaded twice). have invested several hours looking similar question (trailing commas seems mutual mistake) nil has helped me other isolate problem.

thanks, hope guys can help me , others may find same problem solve it.

edit: added versions.

after meddling bit, managed working. ended changing few things. first, changed string format utilize dashes "-" instead of commas, new json object looked this:

[ [ { "start": "2014-05-01", "title": "event test 2", "content": "avec du texte pour en mettre plus", "id": 153 } ], [ { "start": "2014-04-16", "title": "event test", "content": "<p>du texte pour le premier événement.</p>", "id": 118 } ] ]

and then, changed way construction objects getting passed fullcalendar:

for(var = 0; < jsondata.length; i++){ for(var k = 0; k < jsondata[i].length; k++){ /* creating date object instead of string */ var d = new date(jsondata[i][k]['start']); /* adding 1 day, showing previous day (due localisation?) */ d.setdate( d.getdate() + 1); /* manually setting object, , adding 'allday':true , in case need them day events */ dataevents.push({ 'start' : d, 'title' : jsondata[i][k]['title'], 'content' : jsondata[i][k]['content'], 'id' : jsondata[i][k]['id'], 'allday' : true }); } }

it working fine after that. guess ie cannot interpret strings date same way other browsers do. way, safari showing same results ie, not displayed events, after alter displaying in mayor browsers.

i post link working page 1 time live (currently live in our private prod servers, should migrated live servers soon).

javascript jquery ajax json fullcalendar

No comments:

Post a Comment