This repository was archived by the owner on Oct 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,10 @@ handle remainder => sub {
4848 $year_gregorian = DateTime-> now(time_zone => ' Asia/Shanghai' )-> subtract(years => 1) or return ;
4949
5050 # If no relative year was supplied, look for an explicit year
51- # DateTime::Event::SolarTerm only supports 1900--2069
52- } elsif (/ \b (\d {4})\b / ) {
53- return unless 1900 le $1 && $1 le 2069;
51+ # DateTime::Event::SolarTerm only supports 1900--2069, so
52+ # return nothing if the user provides a year outside this range
53+ } elsif (/ \b (\d +)\b / ) {
54+ return unless $1 >= 1900 && $1 <= 2069;
5455 $year_gregorian = DateTime-> new(year => $1 , month => 6, time_zone => ' Asia/Shanghai' );
5556
5657 # Otherwise, default to now if it seems like the user is
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ ddg_goodie_test(
6767 ' chinese zodiac 1900' => test_zci(' Rat' , html => qr / Rat/ ),
6868 ' chinese zodiac 2069' => test_zci(' Ox' , html => qr / Ox/ ),
6969 ' chinese zodiac 2070' => undef ,
70+ ' chinese zodiac 2000000000000' => undef ,
7071
7172);
7273
You can’t perform that action at this time.
0 commit comments