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-Tag: 2.3-final~405 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=99928e2ef834b45a869e8414e996cb012302e7b5;p=fa-stable.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 4a897552..59d8f4af 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); } //_______________________________________________________________