ruby / date

A subclass of Object includes Comparable module for handling dates.
Other
70 stars 35 forks source link

Make julian dates roundtrip through to_time.to_date #8

Closed jeremyevans closed 5 years ago

jeremyevans commented 5 years ago

Previously, julian dates would not round trip through to_time.to_date, because Time is always considered gregorian. This converts the Date instance from julian to gregorian before converting to Time, ensuring that an equal date object will be returned if converting that Time back to Date.

This does result in julian Date objects showing different day values if converting to Time.

Fixes Ruby Bug 8428.