diff --git a/lib/DDG/Goodie/SunInfo.pm b/lib/DDG/Goodie/SunInfo.pm index 0c4a82c4c..2d23c4957 100755 --- a/lib/DDG/Goodie/SunInfo.pm +++ b/lib/DDG/Goodie/SunInfo.pm @@ -34,7 +34,7 @@ handle remainder => sub { (?$lat_lon_regex[NS])\s (?$lat_lon_regex[EW])\s? )? - (?:on|for)?\s? + (?:on|for|at)?\s? (?$datestring_regex)? $/xi; diff --git a/t/SunInfo.t b/t/SunInfo.t index b28f09f60..a024c589a 100755 --- a/t/SunInfo.t +++ b/t/SunInfo.t @@ -126,6 +126,34 @@ ddg_goodie_test( } } ), + 'sunset 7th of march 2017' => test_zci("On 07 Mar 2017, sunrise in Phoenixville, Pennsylvania is at 6:24 AM; sunset at 6:00 PM", + structured_answer => { + data => ignore(), + templates => { + group => 'text', + item => 0, + options => { + title_content => 'DDH.sun_info.title', + content => 'DDH.sun_info.content' + } + } + } + ), + 'sunset at 7 March 2017' => test_zci("On 07 Mar 2017, sunrise in Phoenixville, Pennsylvania is at 6:24 AM; sunset at 6:00 PM", + structured_answer => { + data => ignore(), + templates => { + group => 'text', + item => 0, + options => { + title_content => 'DDH.sun_info.title', + content => 'DDH.sun_info.content' + } + } + } + ), + + 'sunset for philly' => undef, 'sunrise on mars' => undef, 'sunset boulevard' => undef,