Closed Bug 328911 Opened 14 years ago Closed 14 years ago

Current date indicator doesn't change until part the way through the day

Categories

(Calendar :: Internal Components, defect, minor)

x86
Windows XP
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sam, Assigned: martinschroeder)

Details

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5

My timezone in Windows is GMT+12:00 Auckland/Wellington. I have the timezone in Calendar (My Timezone) set to Pacific/Auckland. In the morning the current date indicator is on yesterdays date, and the Go To Today button moves to yesterdays date. In the afternoon, the current date indicator and Go To Today button both correctly move to todays date. I suspect Calendar picks up the correct date at 12pm, due to being GMT+12, but have not confirmed this.

Reproducible: Always

Steps to Reproduce:
1. Set Windows timezone to GMT+12:00 Auckland/Wellington
2. Set Calender My Timezone to Pacific/Auckland.
3. At a time between 12:00am and 11:59am, check the position of the current date indicator, and press the Go To Today button.

Actual Results:  
The current date indicator is on yesterdays date, and the Go To Today button moves to yesterdays date.

Expected Results:  
The current date indicator should be on todays date, and the Go To Today button should  move to todays date.
Please specify the product (Sunbird, Lightning, Calendar extension) and the product version (0.2, 0.3a1, trunk, ...) you are using.

If you are using the 'stable' calendar extension (version 0.2) (see http://www.mozilla.org/projects/calendar/download.html#experimental_stable) this bug will not be worked on until you can reproduce the problem with a recent Sunbird/Lightning build containing all the bugfixes.

You can find the most recent build at http://ftp.mozilla.org/pub/mozilla.org/calendar/sunbird/nightly/latest-trunk/. 
Caution: Backup your profile before testing or use a separate profile for testing.
I noticed a nearly similar behavior. After midnight the current date indicator is on yesterdays date, but the GoToToday button moves to the correct date. My timezone is Europe/Berlin.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → Trunk
I am also using timezone of  /Pacfic/Auckland  and reside in Wellington.  This may not be significant.

Also seeing same problem.  Just retested again, with Sunbird nightly (20060406).

Possible symptom: export of  Home  calendar sometimes (but not always) shows addition of: TZID=/mozilla.org/20050126_1/Antarctica/McMurdo  to all dates.

This appears to be added when an event in calendar is edited.  Also can only force TODAY to 'move' by going forward (in Month view) to next month and the selecting 'Go to Today'.
I found the cause of the problem with the current date indicator and will prepare a fix for that. But I can't reproduce the problem with GoToToday moving to yesterday. So please test this again with a latest build and report back.
Assignee: base → mschroeder
Status: NEW → ASSIGNED
Attached patch Patch v1Splinter Review
Set date.isDate after calculating the date with correct timezone.
Attachment #218049 - Flags: first-review?(jminta)
Clarification on  Comment #3:
 - When the 11:00am / midday point passed, I was able to more the 'Today' (light blue) by <month forward>, <Go to Today>.

In other words, it needs a kick to correct itself when time / timezone catches up.
Note: no timezone data is shown
Note: timezone now as  Antarctica/McMurdo

N.B. No change in behaviour, testing with latest nightly: 0.3a1+ (04-11)
Summary:

When Sunbird started (8:35am NZ local) shows Apr-11 as blue, Apr-12 as yellow
 - tested on nightly 0.3a1+ 0410

Re-tested (9:05am NZ local), with latest nightly 0.3a1+ 0411
 - NO noted change.

Also all-day events show as  12:00pm - 12:00pm (next day).  Later in year (after Oct-1, NZ daylight starts) they show as  01:00pm - 01:00pm (next day).

This is Zulu / UTC.  Why?

Running: W2K Pro, latest patches, 1GB RAM
Sytem is set to  Pacific/Auckland, as is Sunbird - My Timezone
Attachment #218087 - Attachment mime type: application/octet-stream → text/plain
Attachment #218090 - Attachment mime type: application/octet-stream → text/plain
>In other words, it needs a kick to correct itself when time / timezone catches
>up.

With the patch landed the view will show the correct highlight for every timezone at midnight after a "refresh" of the view, e.g. change of view.


>Note: timezone now as  Antarctica/McMurdo

This sounds like bug 328996.


>Also all-day events show as  12:00pm - 12:00pm (next day).  Later in year
>(after Oct-1, NZ daylight starts) they show as  01:00pm - 01:00pm (next day).

This sounds like bug 332868.


>This is Zulu / UTC.  Why?

I think because it's an all-day event, so no other timezone needed.
Tested at 11:30am (NZ local), no change

Tested at 12:03pm (NZ local), now shows yellow for Apr-12, with blue border
 - That is, now correct (caught up)

I'm still studying Comment #11, and not sure if this explains what I see ..

Even if calendar loaded has timezones, Sunbird shows all bubble details for events as UTC / Zulu time.  So Sunbird has NO timezone functionality.
Comment on attachment 218049 [details] [diff] [review]
Patch v1

This looks good to me, but since it's tbe's code originally, I'd like to make sure he didn't have some special trick in mind when doing isDate first.

r=jminta
Attachment #218049 - Flags: second-review?(thomas.benisch)
Attachment #218049 - Flags: first-review?(jminta)
Attachment #218049 - Flags: first-review+
Sorry, been fairly busy on other matters ..

But have tested as follows:
  (further conclusions, and linkage to other bugs, to follow)

for Sunbird 0.3a1+ (0412)


Test 1:  annual, All day event

load (import)
	RRULE:FREQ=YEARLY;INTERVAL=1
	DTSTART;VALUE=DATE:20060205
	DTEND;VALUE=DATE:20060206
view (hover-popup)
	Sunday, 5 February 2006 01:00pm - Monday, 6 February 2006 01:00pm
	( BUT an event straddling 2 days, and treated as UTC against NZ daylight (+13) )
edit
	From  05-Feb-2006  12:00am [tick] All Day
	To  05-Feb-2006  12:00am
	( BUT should show: 06-Feb-2006  12:00am )
<OK>
view (hover-popup)
	Sunday, 5 February 2006 12:00am - Monday, 6 February 2006 12:00am
	( correct )
edit
	From 05-Feb-2006  12:00am [tick] All Day
	To 05-Feb-2006  12:00am
	( BUT should show: 06-Feb-2006  12:00am )
<OK>
save (export)
	RRULE:FREQ=YEARLY;INTERVAL=1
	DTSTART;VALUE=DATE;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060205
	DTEND;VALUE=DATE;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060206
	( correct, BUT no control over timezone used )
load (import)
	RRULE:FREQ=YEARLY;INTERVAL=1
	DTSTART;VALUE=DATE;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060205
	DTEND;VALUE=DATE;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060206
	( as exported, previous step )
view (hover-popup)
	Sunday, 5 February 2006 01:00pm - Monday, 6 February 2006 01:00pm
	( as above, step 2 )
edit
	From  05-Feb-2006  12:00am [tick] All Day
	To  05-Feb-2006  12:00am
	( as above, step 3 )


Test 2:  create new event (within single day)

create (today, from 9:30am to 1:15pm)
view (hover-popup)
	Thursday, 13 April 2006 09:30am - 01:15pm
	( correct )
edit
	From  13-Apr-2006  9:30am
	To  13-Apr-2006  1:15pm
	( correct )
<OK>
view (hover-popup)
	Thursday, 13 April 2006 09:30am - 01:15pm
	( correct )
save (export)
	DTSTART;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060413T093000
	DTEND;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060413T131500
	( correct, BUT no control over timezone used )
load (import)
	DTSTART;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060413T093000
	DTEND;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060413T131500
	( as exported, previous step )
view (hover-popup)
	Thursday, 13 April 2006 09:30am - 01:15pm
	( as above, step 2 )
save (export)
	DTSTART:20060412T213000Z
	DTEND:20060413T011500Z
	( correct, BUT now stated as UTC time )
-- without re-loading (import) --
edit
	From  13-Apr-2006  9:30am
	To  13-Apr-2006  1:15pm
	( as above, step 3 )
<OK>
save (export)
	DTSTART;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060413T093000
	DTEND;TZID=/mozilla.org/20050126_1/Antarctica/McMurdo:20060413T131500
	( as above, step 5 )
Andrew: Thanks for your detailed information. Please look at current bug reports on problems with timezones & daylight saving time. Post your comments in an appropriate existing bug or file a new one. This bug is _only_ for the current date indicator problem.
Sorry, (NZ time) was busy immediately prior to Easter holiday (fri thru mon).

Yes, this bug is just about indicator not changing.  But I am still identifying differences against the other bugs, where what I have notices doesn't quite match what they have identified.

I posted this testing, in case in triggers anyone else to clear some of this up.

Will post comments to: 300605, 304451, 305432, 307557, etc.  ASAP
Update: (for Sunbird 0.3a1+ 0408)

Still shows 'today' (blue, blue outiline) on startup, and after 'Go To Today', as UTC equivalent of local time.  For New Zealand, that is 12 hours behind.

NOTE: The current 'focus' (light amber) on startup, and after 'Go to Today', is CORRECT for local time.

This should also show equivalent behaviour in other time zones.  Can anyone confirm?
Sorry, sticky fingers

should read:  for Sunbird 0.3a1+ 0418
Comment on attachment 218049 [details] [diff] [review]
Patch v1

This patch looks fine.

When writing this piece of code I had a wrong understanding
of the JavaScript Date object. I wrongly assumed, that the 
Date object has no timezone information.
The idea was, that getInTimezone() doesn't convert the date,
but sets the timezone only if isDate is true.
But this is wrong.

After applying the patch, date is correctly converted to
the view's timezone.
Attachment #218049 - Flags: second-review?(thomas.benisch) → second-review+
Whiteboard: [needs landing]
I was persuaded to go ahead and land this for 0.3a2.  Patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Tested in latest Sunbird nightly (20060428 Mozilla Sunbird/0.3a2).

Problem now resolved.

Still have same problem, as noted in Comment 10
> .. all-day events show as  12:00pm - 12:00pm (next day).  Later in year
> (after Oct-1, NZ daylight starts) they show as  01:00pm - 01:00pm (next day).

Not sure if suggestion in Comment 11 is the answer ..
> This sounds like bug 332868
further to comment 21

Seperating this to NEW bug 335882 (trivial), as minor variation of bug 328911.
You need to log in before you can comment on or make changes to this bug.