From 57d9b60f6eac6388e123c080e25f4b415471db35 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sun, 7 Jun 2015 21:26:53 -0400 Subject: [PATCH] Bug 14362: PEGI15 Circulation/AgeRestrictionMarkers test fails It is best to test when UTC date is a date in the future compared to your timezone. I'm in Eastern, so right now, I expect this test to fail for another 2.5 hours. TEST PLAN --------- 1) prove t/Circulation/AgeRestrictionMarkers.t -- fails for PEGI 15. 2) Apply patch 3) prove t/Circulation/AgeRestrictionMarkers.t -- works. 4) koha qa test tools Test Remarks (without patch) PASS - in my actual timezone i.e. IST (GMT +0530). FAIL - with timezone switched to US/Eastern Test Remarks (patch applied) PASS - in my actual timezone i.e. IST (GMT +0530). PASS - with timezone switched to US/Eastern Signed-off-by: Indranil Das Gupta (L2C2 Technologies) --- C4/Circulation.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d825d81..7182277 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3916,7 +3916,8 @@ sub GetAgeRestriction { } #Get how many days the borrower has to reach the age restriction - my $daysToAgeRestriction = Date_to_Days(@alloweddate) - Date_to_Days(Today); + my @Today = split /-/, DateTime->today->ymd(); + my $daysToAgeRestriction = Date_to_Days(@alloweddate) - Date_to_Days(@Today); #Negative days means the borrower went past the age restriction age return ($restriction_year, $daysToAgeRestriction); } -- 1.9.1