ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

http://zcal.zkoss.org/ stopped working

gcarlos
18 Mar 2010 10:13:44 GMT
18 Mar 2010 10:13:44 GMT

Hi there is something wrong with ZK Calendars component. Even the simple demo @ http://zcal.zkoss.org/ stopped working. Unfortunately for me so did the calendars component in my application.

Please HELP!

Please see also http://www.zkoss.org/forum/listComment/11695.

Thank you.
Alex

Cogito
18 Mar 2010 20:45:05 GMT
18 Mar 2010 20:45:05 GMT

Hi gcarlos,
I wasn't able to reproduce the problem you mentioned on http://zcal.zkoss.org/.
Could you give us more detail in reproducing the error?

gcarlos
22 Mar 2010 10:21:04 GMT
22 Mar 2010 10:21:04 GMT

Hi Cogito,

The calendars component stopped working for me last week. I found out that if you created a CalendarEvent for the week 15.03-21.03 the component never finished loading. The same happened with http://zcal.zkoss.org/. This was very surprising to me because I use the component for developing a POC and it worked for me all the time. I tried several browsers cleared the cache tried it from different pcs. Nothing worked for that week !?

Now the component works - without any changes - for me again and so does http://zcal.zkoss.org/. Very interesting.

What I did was just to create an CalendarEvent for eg. 17.03.2010. After adding it to the SimpleCalendarModel it showed me the "Processing..." message and that message never went away. With Chrome I even saw the "Oh SNAP!" message and the browser disabled JavaScript after that. I am pretty confident that there is something wrong for that week. Don't ask me what ;-) It did - and still does - not make sense to me at all. But what always worked was that I could add CalendarEvents before or after that week. So it must have something todo with this particular week.

To Reproduce: Perhaps change the OS Date to 17.03.2010 and try to run the Calendars demo on that machine to see for yourself.

I know my explanation is not very detailed but even after 6 hours of looking into that problem I could not figure out what had caused that error.
Alex

jimmyshiau
22 Mar 2010 10:42:52 GMT
22 Mar 2010 10:42:52 GMT

Hi, Alex,
You can download the jar that I fixed in svn
http://zkcalendar.googlecode.com/svn/trunk/zkcalendar/dist/lib/calendar.jar
I try my local demo that it was solved in my fixed.
is it solve on you?

gcarlos
22 Mar 2010 11:08:13 GMT
22 Mar 2010 11:08:13 GMT

Thank you as1225.

I will try your fix and let you know.

Alex

gcarlos
22 Mar 2010 11:53:14 GMT
22 Mar 2010 11:53:14 GMT

Hi as1225,

I could reproduce the error:
1) set OS date to 17.03
2) open the CalendarDemo on your local machine.

Unfortunately your fix did not work for me.

The only CalendarEvent I have in my model (for the whole week) is :
{"headerColor":"#ff6633","contentColor":"#668CD9","content":"test content","beginDate":"1268842861547","endDate":"1268846461547","isLocked":"true","zclass":"z-calevent"}

and I am loading the calendar with week view.

Date for event is 17.03.2010 and it lasts for one hour.

I am clueless. ;-(

Please see also this screenshot

Alex

ysartori
31 Mar 2010 08:08:41 GMT
31 Mar 2010 08:08:41 GMT

Hi gcarlos,
i've found this problem one month ago, when i worked on a project using zk calendar.
the cause is the own used time zone. infact, the problem is between daylight saving time and local time (28 march 2010).
i fix it modifying the method "fixTimeZoneFromServer" of calendars.js included in the original calendar.jar :

fixTimeZoneFromServer : function(b, a) {
var date1 = new Date(b.getFullYear(), 0, 1, 0, 0, 0, 0);
var temp = date1.toGMTString();
var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")-1));
var hoursDiffStdTime = (date1 - date3) / (1000 * 60 * 60);

return new Date(b.getTime() + ((-60*hoursDiffStdTime) + a) * 60000)
}

gcarlos
1 Apr 2010 17:26:13 GMT
1 Apr 2010 17:26:13 GMT

Hi ysartori,

Thank you very much for your post. I appreciate your answer very much!