Issue #15742 has been updated by duerst (Martin D=FCrst).


nobu (Nobuyoshi Nakada) wrote:

> Note: JIS X 0301 states the era symbol is optional, but doesn't mention t=
he default era in the case it is omitted.
> At the best, it will be defined by the application(s), I guess, like anno=
uncers in ISO/IEC 2022.

It's a sign that the committee responsible for JIS X 0301 wasn't able to ag=
ree, or didn't have any really good idea how it would work, or both. Essent=
ially, it's similar to the Y2K problem, except it occurs more often.

----------------------------------------
Feature #15742: Add Date#jisx0301 support new Japanese era
https://bugs.ruby-lang.org/issues/15742#change-77420

* Author: kaishuu0123 (Koki Oyatsu)
* Status: Feedback
* Priority: Normal
* Assignee: =

* Target version: =

----------------------------------------
## Reproduce process

```
irb(main):002:0> require 'date'
=3D> true
irb(main):003:0> Date.new(2019, 5, 1).jisx0301
=3D> "H31.05.01"
```

* ruby version: trunk

## Result of reproduce process

```
irb(main):003:0> Date.new(2019, 5, 1).jisx0301
=3D> "H31.05.01"
```

## Expected result and the reason why you expect

```
irb(main):002:0> require 'date'
=3D> true
irb(main):003:0> Date.new(2019, 5, 1).jisx0301
=3D> "R01.05.01"
```

### reason

* new era (Reiwa?) starts from 2019/05/01
* refs: https://github.com/ruby/ruby/blob/trunk/ext/date/date_core.c#L7049
* I can't be sure that initial letter is "R".



-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>