From 395cadfddfe5253a1af7d83c8de1195cae15ccfa Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sat, 16 Mar 2013 15:34:09 +0000 Subject: [PATCH] new timezone handling with timezoneJS.date.js Does not work with DST yet... Maybe rewrite the js date/timehandling in php.... Status: does not work as expected! --- js/dialogs/ImportPanel.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/dialogs/ImportPanel.js b/js/dialogs/ImportPanel.js index 98f90e3..bee7b1d 100644 --- a/js/dialogs/ImportPanel.js +++ b/js/dialogs/ImportPanel.js @@ -124,16 +124,23 @@ Zarafa.plugins.calendarimporter.dialogs.ImportPanel = Ext.extend(Ext.Panel, { if(eventdata.events[i]["VALARM"]) { trigger = eventdata.events[i]["VALARM"]["TRIGGER"]; dtrigger = new timezoneJS.Date(parseInt(trigger) + local_tz_offset + tz_offset, "Etc/UTC"); - if(this.timezone !== null) { + if(typeof this.timezone !== "undefined" && this.timezone !== null) { dtrigger.setTimezone(this.timezone); + var realtzoffset = dtrigger.getTimezoneOffset() * 60; + dtrigger = new timezoneJS.Date(parseInt(trigger) + local_tz_offset + realtzoffset, this.timezone); } } var dstart = new timezoneJS.Date(parseInt(eventdata.events[i]["DTSTART"]) + local_tz_offset + tz_offset, "Etc/UTC"); var dend = new timezoneJS.Date(parseInt(eventdata.events[i]["DTEND"]) + local_tz_offset + tz_offset, "Etc/UTC"); - if(this.timezone !== null) { + + + if(typeof this.timezone !== "undefined" && this.timezone !== null) { dstart.setTimezone(this.timezone); dend.setTimezone(this.timezone); + + dstart = new Date(dstart.getUTCTime() + local_tz_offset + tz_offset); + dend = new Date(dend.getUTCTime() + local_tz_offset + tz_offset); } console.log(this.timezone); console.log(dstart);