Skip to content

Instantly share code, notes, and snippets.

@headius

headius/patch.diff

Created Oct 30, 2017
Embed
What would you like to do?
Replace Gregorian/Julian chrono with ISO in date.rb
diff --git a/lib/ruby/stdlib/date.rb b/lib/ruby/stdlib/date.rb
index ad36703759..d40bf7073a 100644
--- a/lib/ruby/stdlib/date.rb
+++ b/lib/ruby/stdlib/date.rb
@@ -712,7 +712,7 @@ class Date
end
chrono = if sg == ITALY
- JODA.chrono::GJChronology
+ JODA.chrono::ISOChronology
elsif sg == JULIAN
JODA.chrono::JulianChronology
elsif sg == GREGORIAN
@@ -724,7 +724,7 @@ class Date
else
constructor = JODA::Instant.java_class.constructor(Java::long)
cutover = constructor.new_instance JODA::DateTimeUtils.fromJulianDay(jd_to_ajd(sg, 0))
- JODA.chrono::GJChronology.getInstance(tz, cutover)
+ JODA.chrono::ISOChronology.getInstance(tz, cutover)
end
end
end
@@ -735,7 +735,7 @@ class Date
DEFAULT_TZ = ENV['TZ']
DEFAULT_DTZ = JODA::DateTimeZone.getDefault
CHRONO_ITALY_DEFAULT_DTZ = chronology(ITALY, DEFAULT_DTZ)
- CHRONO_ITALY_UTC = JODA.chrono::GJChronology.getInstance(JODA::DateTimeZone::UTC)
+ CHRONO_ITALY_UTC = JODA.chrono::ISOChronology.getInstance(JODA::DateTimeZone::UTC)
# Is a year a leap year in the Julian calendar?
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.