Bill Clark wrote:
I'd like to propose that an option be added to display years according to the BCE convention rather than the current BC one.
It looks like within DateFormatter.php,
NormalYear() will need to understand the extra option,
the switch statement within replace() will need to have a case for it,
and a new regex/key/target/rule will need to be added into DateFormatter().
Also, wfMsg("dateformat") will need to be updated appropriately.
Is there anything else I'm missing? Would anyone be willing to help me with this (I'm really loathe to start creating diffs until I understand the code better).
You could add another character to indicate BCE years instead of BC years, to replace "Y", and then you could add another date format for each of the 4 formats containing Y.
Another option, which may or may not be easier, would be to allow the Y character to indicate either BC or BCE. You could change the year regex to match either. You'd have another member variable in addition to mTarget to indicate which year format is desired. Then you could add code to the "Y" case in replace() to convert to the desired format.
Note that you'll need to change SpecialPreferences.php to add a checkbox and to set the option in User. You could probably put both date preferences into a single option field in User.
If the user has the "no preference" (DF_NONE) preference selected, if it was up to me I would ignore the BC/BCE checkbox and preserve whatever format is in the text. Use your judgement on that, people will complain either way.
-- Tim Starling