Index: trunk/phase3/languages/Language.php |
— | — | @@ -1154,11 +1154,25 @@ |
1155 | 1155 | # Months and days are identical |
1156 | 1156 | $gy_offset = $gy - 1911; |
1157 | 1157 | } else if (!strcmp($cName,'tenno')) { |
1158 | | - # Minguo dates up to Showa period |
| 1158 | + # Nengō dates up to Meiji period |
1159 | 1159 | # Deduct years from the Gregorian calendar |
1160 | 1160 | # depending on the nengo periods |
1161 | 1161 | # 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))) { |
1163 | 1177 | # Shōwa period |
1164 | 1178 | $gy_gannen = $gy - 1926 + 1; |
1165 | 1179 | $gy_offset = $gy_gannen; |