r50827 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50826‎ | r50827 | r50828 >
Date:15:49, 20 May 2009
Author:shinjiman
Status:ok
Tags:
Comment:
follow up r50804, adding two further Japanese era names.
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -1154,11 +1154,25 @@
11551155 # Months and days are identical
11561156 $gy_offset = $gy - 1911;
11571157 } else if (!strcmp($cName,'tenno')) {
1158 - # Minguo dates up to Showa period
 1158+ # Nengō dates up to Meiji period
11591159 # Deduct years from the Gregorian calendar
11601160 # depending on the nengo periods
11611161 # Months and days are identical
1162 - if (($gy < 1989) || (($gy == 1989) && ($gm == 1) && ($gd < 8))) {
 1162+ if (($gy < 1912) || (($gy == 1912) && ($gm < 7)) || (($gy == 1912) && ($gm == 7) && ($gd < 31))) {
 1163+ # Meiji period
 1164+ $gy_gannen = $gy - 1868 + 1;
 1165+ $gy_offset = $gy_gannen;
 1166+ if ($gy_gannen == 1)
 1167+ $gy_offset = '元';
 1168+ $gy_offset = '明治'.$gy_offset;
 1169+ } else if ((($gy == 1912) && ($gm == 7) && ($gd == 31)) || (($gy == 1912) && ($gm >= 8)) || (($gy > 1912) && ($gy < 1926)) || (($gy == 1926) && ($gm < 12)) || (($gy == 1926) && ($gm == 12) && ($gd < 26))) {
 1170+ # Taishō period
 1171+ $gy_gannen = $gy - 1912 + 1;
 1172+ $gy_offset = $gy_gannen;
 1173+ if ($gy_gannen == 1)
 1174+ $gy_offset = '元';
 1175+ $gy_offset = '大正'.$gy_offset;
 1176+ } else if ((($gy == 1926) && ($gm == 12) && ($gd >= 26)) || (($gy > 1926) && ($gy < 1989)) || (($gy == 1989) && ($gm == 1) && ($gd < 8))) {
11631177 # Shōwa period
11641178 $gy_gannen = $gy - 1926 + 1;
11651179 $gy_offset = $gy_gannen;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r50804* (bug 18849) Added Japanese and North Korean calendars supportshinjiman01:53, 20 May 2009

Status & tagging log