ruby/psych

Calendar info in `Date`/`DateTime` is lost

nobu opened this issue · 0 comments

nobu commented
$ ruby -rdate -rpsych \
  -e 'di = Date.new(1000, 1, 1, Date::ITALY)' \
  -e 'dg = Date.new(1000, 1, 1, Date::GREGORIAN)' \
  -e 'puts Psych.dump([di, dg]), di == dg'
---
- 1000-01-01
- 1000-01-01
false

As shown by the last false di and dg are different dates, but cannot distinguish in the YAML dumped by Psych.