diff options
Diffstat (limited to 'ext/date')
-rw-r--r-- | ext/date/date_core.c | 6 | ||||
-rw-r--r-- | ext/date/date_parse.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c index b6f806ff1f..67ed6171a7 100644 --- a/ext/date/date_core.c +++ b/ext/date/date_core.c @@ -7039,10 +7039,14 @@ jisx0301_date_format(char *fmt, size_t size, VALUE jd, VALUE y) c = 'S'; s = 1925; } - else { + else if (d < 2458605) { c = 'H'; s = 1988; } + else { + c = 'R'; + s = 2018; + } snprintf(fmt, size, "%c%02ld" ".%%m.%%d", c, FIX2INT(y) - s); return fmt; } diff --git a/ext/date/date_parse.c b/ext/date/date_parse.c index 5bd10fb061..e0634c39f1 100644 --- a/ext/date/date_parse.c +++ b/ext/date/date_parse.c @@ -1212,7 +1212,7 @@ parse_iso2(VALUE str, VALUE hash) return 1; } -#define JISX0301_ERA_INITIALS "mtsh" +#define JISX0301_ERA_INITIALS "mtshr" #define JISX0301_DEFAULT_ERA 'H' /* obsolete */ static int @@ -1225,6 +1225,7 @@ gengo(int c) case 'T': case 't': e = 1911; break; case 'S': case 's': e = 1925; break; case 'H': case 'h': e = 1988; break; + case 'R': case 'r': e = 2018; break; default: e = 0; break; } return e; |