The issue is that YAML cannot retain calendar information.
When Psych serializes a Date object, it converts it to Date::GREGORIAN (the proleptic Gregorian calendar).
As a result, the serialized YAML contains --- 1582-10-14, which is intentional.
When deserializing a Date from YAML, a Date::GREGORIAN Date object is generated.
I believe it would be possible to convert it to an Date::ITALY Date object by default.
However, consider a case where a user manually writes --- 1582-10-14 in YAML and loads it with Psych.
They would then get Date.new(1582, 10, 4), which could be an unexpected result.
For this reason, I thinkg the current behavior is unavoidable.
If you have a specific proposal on how to fix it, please write it.
I suggest Psych.dump and Psych.load should deal the date as the default style Date::ITALY, like Date.new.
Normal people only know Date::ITALY, which skip 1582-10-05~1582-10-14.
I also suggest Date.to_s should convert inner date style to Date::ITALY, then output it.
Status changed from Feedback to Third Party's Issue
Backport changed from 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN to 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED, 3.4: DONTNEED
YAML has no specification of calendar systems.
If YAML specifies it, we would obey it of course.
Until then, YAML is not suitable for such dates, just don't use such dates.