Version: (using KDE Devel) Installed from: Compiled sources Compiler: gcc version 4.2.3 20071123 (prerelease) (Debian 4.2.2-4) OS: Linux In plasma, the digital clock applet/plasmoid now has a KDatePicker widget, I was just playing around by looking at Year 1 (1 AD) when I selected the week combobox, It showed 'Week -1 *' Attached is picture
Created attachment 22539 [details] Picture of error Picture of error showing the weird result from Plasma digital clock applet
The combobox should be showing week 52 or 53 of year 1BC, obviously the maths in the routine is not quite right when crossing the non-existant year 0 divide, it will probably need a special case added to the routine. I'll look at this when I get back next week. In the bug title, you state it crashes apps but provide no further details. Could you detail this further and provide backtraces?
Bug probably lies in KCalendarSystem::weekNumber() so set component to kdecore, update title, cc to me.
There is a problem in the addMonths() and addYears() methods that doesn't cater for there being no year 0 in the Julian/Gregorian calendar that would be contributing to this, but doesn't fully resolve it. Will commit as soon as 4.3 is out the door and open to bug-fixes again.
SVN commit 992292 by jlayt: Fix the Y0K bug The Julian/Gregorian Calendar does not have a Year 0, so all maths on a year needs to adjust for this when moveing over the BC/AD divide. A new private method addYearNumber() does this correctly and should be used in all parts of the code that needs to add years. The Hebrew, Hijri and Jalali calendars are unaffected by this as none of our implementations are proleptic, i.e. allow dates before year 1. In 4.4 when we get calendar systems that do have a Year 0 we will need to modify the addYearNumber() method to repect this. Leave bug open for now as will need to backport to 4.3 once released. CCBUG: 154016 M +50 -21 kcalendarsystem.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=992292
I found a few more places to fix and this fix fully resolves the issue.
SVN commit 1007713 by jlayt: Fix the Y0K bug. Backport commit 992292 from trunk. The Julian/Gregorian Calendar does not have a Year 0, so all maths on a year needs to adjust for this when moving over the BC/AD divide. A new private method addYearNumber() does this correctly and should be used in all parts of the code that needs to add years. The Hebrew, Hijri and Jalali calendars are unaffected by this as none of our implementations are proleptic, i.e. allow dates before year 1. In 4.4 when we get calendar systems that do have a Year 0 we will need to modify the addYearNumber() method to repect this. BUG: 154016 M +50 -21 kcalendarsystem.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1007713