Closed Bug 427006 Opened 15 years ago Closed 15 years ago

Timezone offset incorrectly calculated for negative half hour timezones

Categories

(Calendar :: Provider: GData, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: larry, Assigned: Fallen)

References

Details

(Whiteboard: [gdata-0.5])

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.04506)
Build Identifier: March 31st, 2008  Nightly build of Lightning/Google Data Provider

Whenever I add or update an event from Lightning using the Provider for Google
Calendar on my Windows Vista notebook, the event is moved one hour into the
future.  I've been having this problem for about a year and it's slowly driving
me insane.  I have to dismiss event alarms each and every hour once the event
occurs unless I delete the event from my calendar.

I've tried this with the March 31st, 2008 nightly download of 0.8pre
Lightning/Google Provider and the problem still exists.

My Lightning timezone is America/St_Johns.  My computer timezone is (GMT-03:30)
Newfoundland.  I cannot use the same string setting on my computer and in
lightning as like-named options don't exist. Both these timezones are GMT-3:30
during standard time and GMT-2:30 during daylight savings time.


Reproducible: Always

Steps to Reproduce:
1. Set Computer timezone to (GMT-3:30) Newfoundland
2. Set Lightning timezone to America/St_Johns
3. Create an event within Lightning

Actual Results:  
The time component of the event that's added to the Google Calendar is off by an hour

Expected Results:  
The time should have been set as requested.

Please see below for a debug log of adding a test event from Lightning.  Notice
the hour difference in the event start/stop times.  This log was generated on
March 10th with the latest nightly build as of that time but the problem still exists in the March 31st version.

Adding item Test Event

Logging object...
action: Setting Upload Data:
content: application/atom+xml; charset=UTF-8
data: <entry xmlns:gd="http://schemas.google.com/g/2005"
xmlns:gCal="http://schemas.google.com/gCal/2005"
xmlns="http://www.w3.org/2005/Atom">
 <category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/g/2005#event"/>
 <title type="text">Test Event</title>
 <content type="text">test event</content>
 <author>
   <name>someone@somewhere.net</name>
   <email>someone@somewhere.net</email>
 </author>
 <gd:transparency value="http://schemas.google.com/g/2005#event.opaque"/>
 <gd:eventStatus value="http://schemas.google.com/g/2005#event.confirmed"/>
 <gd:where valueString=""/>
 <gd:who email="someone@somewhere.net"
rel="http://schemas.google.com/g/2005#event.organizer"
valueString="someone@somewhere.net"/>
 <gCal:sendEventNotifications value="false"/>
 <gd:when startTime="2008-03-10T15:00:00-03:30"
endTime="2008-03-10T16:00:00-03:30"/>
 <gd:extendedProperty name="X-MOZ-LASTACK" value=""/>
 <gd:extendedProperty name="X-MOZ-SNOOZE-TIME" value=""/>
 <gd:visibility value="http://schemas.google.com/g/2005#event.default"/>
</entry>
End object

calGoogleRequest: Requesting POST
http://www.google.com/calendar/feeds/blahblahblah

Logging calIEvent:
   id: someidstring
   editurl:http://www.google.com/calendar/feeds/blahblahblah
   created:2008/03/10 17:08:46 UTC isDate=0
   updated:2008/03/10 17:08:47 UTC isDate=0
   title:Test Event
   content:test event
   transparency:OPAQUE
   status:CONFIRMED
   startTime:2008/03/10 16:00:00 /mozilla.org/20071231_1/America/St_Johns
isDate=0
   endTime:2008/03/10 17:00:00 /mozilla.org/20071231_1/America/St_Johns
isDate=0
   location:
   privacy:DEFAULT
   alarmOffset:null
   alarmLastAck:null
   snoozeTime:null
   isOccurrence: null
   Organizer:
       ID: MAILTO:someone@somwehere.com
           Name: Some Body
           Rsvp: false
           Is Organizer: yes
           Role: null
           Status: null
   Attendees:
   recurrence: no
Math.floor(-2.5) = -3, which shifts hours by one for half hour timezones with a negative timezone offset. This patch fixes and also tells Google to convert timezone to the calendar default timezone.

Too bad Math.sgn() is not a function, that would have made code smoother :-)

Checkin should wait for bug 430254, since I don't want to bitrot that patch again!
Assignee: nobody → philipp
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #318343 - Flags: review?(daniel.boelzle)
Depends on: 430254
OS: Windows Vista → All
Hardware: PC → All
Summary: Local edits in Thunderbird move Google Calendar events one hour into future → Timezone offset incorrectly calculated for negative half hour timezones
Comment on attachment 318343 [details] [diff] [review]
Preset timezones and fix conversion

r=dbo
Attachment #318343 - Flags: review?(daniel.boelzle) → review+
Checked in on HEAD and MOZILLA_1_8_BRANCH

-> FIXED
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [gdata-cvs]
Whiteboard: [gdata-cvs] → [gdata-0.5]
You need to log in before you can comment on or make changes to this bug.