Bug 14362: PEGI15 Circulation/AgeRestrictionMarkers test fails
[koha.git] / C4 / Circulation.pm
index 6f149ce..dd3d44c 100644 (file)
@@ -3923,7 +3923,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);
         }