[ wxwindows-Bugs-1825360 ] wxCalendarCtrl: October 2007 has 32 days
SourceForge.net
noreply at sourceforge.net
Sat Mar 15 19:20:29 PDT 2008
Bugs item #1825360, was opened at 2007-11-03 16:23
Message generated for change (Comment added) made by sf-robot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1825360&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Generic
Group: None
>Status: Closed
Resolution: None
Priority: 7
Private: No
Submitted By: Torsten Martinsen (bullestock)
Assigned to: Vadim Zeitlin (vadz)
Summary: wxCalendarCtrl: October 2007 has 32 days
Initial Comment:
Windows XP
wxWidgets 2.6.3.0
When setting the Windows timezone to GMT-4:00
Santiago (Auto-DST on), wxCalendarCtrl shows October
2007 with 32 days (Oct 13th exists twice).
Note that this bug is strangely similar to this old one: http://sourceforge.net/tracker/index.php?func=detail&aid=1045080&group_id=9863&atid=109863
----------------------------------------------------------------------
>Comment By: SourceForge Robot (sf-robot)
Date: 2008-03-15 19:20
Message:
Logged In: YES
user_id=1312539
Originator: NO
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
----------------------------------------------------------------------
Comment By: Steven Van Ingelgem (g00fy)
Date: 2008-03-02 01:48
Message:
Logged In: YES
user_id=569271
Originator: NO
Hey Vadim,
I checked it again against trunk and I don't see this issue anymore now.
Greetings
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2008-03-01 16:26
Message:
Logged In: YES
user_id=71618
Originator: NO
I'm still missing something here... I just can't reproduce the bug at all.
What I did:
0. Start with a fresh XP SP1 (it's a VM snapshot)
1. Changed time zone to GMT-4 in the "Date/Time" control panel applet
2. Run calendar sample
a) change month to October
b) change year to 2007
No problems observed with neither current 2.8 sources nor svn trunk. Could
anybody please tell me how do you manage to observe this problem? Because I
still don't see where does the time component come from, in particular I
really don't think it can come from "date += wxDateSpan::Day()" line as
alluded to in a previous comment because wxDateTime::Add(wxDateSpan) has an
assert which explicitly checks that the time hasn't changed and so it
should be impossible to get 23:00 if the original date had 0:00.
So please let me know more details about how to reproduce this bug, there
is clearly something fishy going on here. Thanks!
----------------------------------------------------------------------
Comment By: Torsten Martinsen (bullestock)
Date: 2008-02-01 15:12
Message:
Logged In: YES
user_id=382855
Originator: YES
FYI, adding
date.SetHour(12);
after
wxDateTime date = GetStartDate();
as per Flávio's suggestion does indeed seem to work.
----------------------------------------------------------------------
Comment By: Steven Van Ingelgem (g00fy)
Date: 2008-01-25 07:22
Message:
Logged In: YES
user_id=569271
Originator: NO
I can see the same behaviour in trunk with the calendar example. The
datepicker control works fine, but the wxCalendarCtrl does not.
----------------------------------------------------------------------
Comment By: Flávio Etrusco (etrusco)
Date: 2008-01-25 07:20
Message:
Logged In: YES
user_id=99702
Originator: NO
Brazil's DST starts on October, if you wanna try ;-)
AFAICS the time component comes from StartDate itself.
I didn't take the time to look at the implementation of ResetTime but I
can't imagine it doing anything other than setting the time 0:00, right?
The problem is triggered exactly when time is 0:00.
Say you are at time 0:00 of the day before DST change (eg. Oct 12th 0:00).
When you increment one day, one can either say it's "Oct 13th 0:00" or "Oct
12th 23:00 DST" (I don't know what the legal/official definition says), and
wxWidgets (or Windows? I didn't dig into timezone implementation)
implements the last one, thus displaying the day before DST twice and
iteration the other days at 23:00.
----------------------------------------------------------------------
Comment By: Vadim Zeitlin (vadz)
Date: 2008-01-25 06:47
Message:
Logged In: YES
user_id=71618
Originator: NO
Unfortunately I still didn't have time to reproduce this (serious) bug but
the problem indeed is probably related to doing arithmetics with time when
we only need dates and so it should probably be possible to fix it by
adding a call to dt.ResetTime(). But the trouble is I don't see where does
the time component come from to start with, has anybody who had already
tried to debug this seen it?
Thanks!
----------------------------------------------------------------------
Comment By: Flávio Etrusco (etrusco)
Date: 2008-01-24 16:47
Message:
Logged In: YES
user_id=99702
Originator: NO
I think the easiest fix would be to set the time of 'date' to midday just
after "wxDateTime date = GetStartDate();", at "src/generic/calctrl.cpp",
line 1039. Or is there any country where DST comes to affect at midday?
:-S
Other option would be to check 'date.isdst' just after incrementing by day
at the end of the loop and increment by a hour, or playing some games with
UTC...
----------------------------------------------------------------------
Comment By: Torsten Martinsen (bullestock)
Date: 2008-01-22 08:58
Message:
Logged In: YES
user_id=382855
Originator: YES
This is still a problem in version 2.8.7.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1825360&group_id=9863
More information about the wx-dev
mailing list