Skip to content

Commit c18016a

Browse files
committed
support 21st century 4 digit year strings for Daterange
1 parent f4c6f36 commit c18016a

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [Unreleased]
22
## Fixed
33
* Add 2028 bank holidays
4+
* support 21st century 4 digit year strings for Daterange
45

56
## 5.10.5 / 2025-11-05
67
## Fixed

lib/ndr_support/daterange.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class Daterange
77
attr_reader :date1, :date2, :source
88

9-
OKYEARS = 1880..2030
9+
OKYEARS = 1880..2099
1010

1111
# Raised when dates are not supplied in the correct order if do_not_flip_dates is passed as true:
1212
class WrongDateOrderError < StandardError; end

test/daterange_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_year_range_attributes
9898
end
9999

100100
def test_year_range_future
101-
s = 2.years.from_now.strftime('%Y')
101+
s = '2099'
102102
dr = Daterange.new(s)
103103
assert_equal s, dr.to_s, "Daterange should support future years up to #{s}"
104104
end

0 commit comments

Comments
 (0)