From: Joe Hunt Date: Wed, 3 Oct 2012 22:58:34 +0000 (+0200) Subject: Minor improvement to add_days/months/years for the new dateformats. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=d4f14bb120a854d4d07b9211a731ce1899579bc8;p=textcart.git Minor improvement to add_days/months/years for the new dateformats. --- 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); } //_______________________________________________________________