Minor improvement to add_days/months/years for the new dateformats.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 3 Oct 2012 22:58:34 +0000 (00:58 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 3 Oct 2012 22:58:34 +0000 (00:58 +0200)
includes/date_functions.inc

index 4a897552f9c5d668bffe7aadd7c5724c8f3e9f1c..59d8f4afafe7f5ee792a62de62db6a347f4976de 100644 (file)
@@ -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);
 }
 
 //_______________________________________________________________