Closed Bug 257132 Opened 20 years ago Closed 20 years ago

Two digit year is considered as 19xx instead of 20xx in datepicker

Categories

(Calendar :: Sunbird Only, defect)

x86
All
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mostafah, Assigned: mostafah)

References

Details

Attachments

(1 file)

As reported in :
http://forums.mozillazine.org/viewtopic.php?t=118981
if you enter 04 in the datepicker it is interpreted as 1904 instead 2004.
Would be good to have two year digits default to the current century.
Ccing gekacheka since he is familiar with the dateUtils.js code.
Currently parseShortDate only converts two digit years to four digit years if
the O.S. date format uses a two digit year.

With this patch it converts two digit years to four digit years in any format.

(Note: this means that it can never parse years from year 0 C.E. to year 99
C.E.  I tried making it possible to specify those years if four digits were
specified, such as year 0099, but it turns out at least on Windows O.S.
dateService.formatDate also converts two digit years to 1900+year so those
years are not presented correctly even if they were parsed correctly.  Since
Calendar currently uses the JavaScript Date object which implements a Gregorian
calendar, and the Gregorian calendar wasn't in use during those years, it is
probably not useful to represent those years anyway.)
Checked in.
Thanks
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Windows (perhaps other OSes) has a system setting to determine how two-digit
years are interpreted. Respecting such a setting where it exists would be optimal.

Of course, the current implementation is wholly satisfactory for now. (But in 90
years' time...)
*** Bug 258563 has been marked as a duplicate of this bug. ***
The bugspam monkeys have been set free and are feeding on Calendar :: Sunbird Only. Be afraid for your sanity!
QA Contact: gurganbl → sunbird
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: