From d4f14bb120a854d4d07b9211a731ce1899579bc8 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 4 Oct 2012 00:58:34 +0200 Subject: [PATCH] Minor improvement to add_days/months/years for the new dateformats. --- includes/date_functions.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 4a89755..59d8f4a 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -292,7 +292,8 @@ function add_days($date, $days) // accepts negative values as well list($year, $month, $day) = gregorian_to_islamic(date("Y", $timet), date("n", $timet), date("j", $timet)); return __date($year, $month, $day); } - return date(user_date_display(), $timet); + list($year, $month, $day) = explode("-", date("Y-m-d", $timet)); + return __date($year, $month, $day); } function add_months($date, $months) // accepts negative values as well @@ -314,7 +315,8 @@ function add_months($date, $months) // accepts negative values as well list($year, $month, $day) = gregorian_to_islamic(date("Y", $timet), date("n", $timet), date("j", $timet)); return __date($year, $month, $day); } - return date(user_date_display(), $timet); + list($year, $month, $day) = explode("-", date("Y-m-d", $timet)); + return __date($year, $month, $day); } function add_years($date, $years) // accepts negative values as well @@ -330,7 +332,8 @@ function add_years($date, $years) // accepts negative values as well list($year, $month, $day) = gregorian_to_islamic(date("Y", $timet), date("n", $timet), date("j", $timet)); return __date($year, $month, $day); } - return date(user_date_display(), $timet); + list($year, $month, $day) = explode("-", date("Y-m-d", $timet)); + return __date($year, $month, $day); } //_______________________________________________________________ -- 2.30.2