0

hi i'm working on full calender I have a problem displaying the values in Mozilla Firefox. where as in Chrome the code works perfectly.

i'm fetching the value from database and displaying it, but as of now i'm using the following static values as input.

var abc = new Array();
abc =[{AddedNew: false,allDay: false,end: "Mon May 13 2013 7:30:00 GMT 0530 (India Standard Time)",getA_ID: "72",id: "[_fc1_3 ",start: "Mon May 13 2013 6:30:00 GMT 0530 (India Standard Time)",title: "mon"}];

Chrome Screenshoot - Using static values enter image description here

Firefox Screenshoot - Using static values enter image description here

The values in console are correct in Chrome and Firefox

I don't know where i'm going wrong or its a problem with Firefox.

4

2 回答 2

1

日历的输入日期字符串没有标准格式(根据插件的文档):

'Mon May 13 2013 7:30:00 GMT 0530 (India Standard Time)' (your format)
'Mon, 13 May 2013 7:30:00 GMT' (expected format)

因为我不是正则表达式的专家,所以只能向您建议以下(工作)修复:

var abc = [{AddedNew: false,allDay: false,end: "Mon May 13 2013 7:30:00 GMT 0530 (India Standard Time)",getA_ID: "72",id: "[_fc1_3 ",start: "Mon May 13 2013 6:30:00 GMT 0530 (India Standard Time)",title: "mon"}];
abc.map(function(item){
    var t = item.end.split(' ');
    item.end = [t[0]+',', t[2], t[1], t[3], t[4], t[5]].join(' ');
    t = item.start.split(' ');
    item.start = [t[0]+',', t[2], t[1], t[3], t[4], t[5]].join(' ');
    return item;
});

小提琴

于 2013-05-15T09:28:59.630 回答
1

这是我正在获取的事件,这适用于 AJAX 调用:您可以与您的进行比较,

<event allDay="false" editable="true" end="Mon May 13 2013 13:00:00 GMT+0100" id="11"   start="Mon May 13 2013 08:00:00 GMT+0100" title="te3ste"/>

<event allDay="false" editable="true" end="Mon May 13 2013 19:00:00 GMT+0100" id="12" start="Mon May 13 2013 14:00:00 GMT+0100" title="hhhhh"/>

<event allDay="false" editable="true" end="Mon May 13 2013 17:00:00 GMT+0100" id="13" start="Mon May 13 2013 15:00:00 GMT+0100" title="hjhj"/>
于 2013-05-15T17:23:57.463 回答