Cleanup in add_months()
[fa-stable.git] / includes / date_functions.inc
index 94525a3307fcc3195c3d1e37d72a6c285636f758..6f8379e072877bbf9413f274ca29366da2af68a6 100644 (file)
@@ -266,11 +266,10 @@ function add_months($date, $months) // accepts negative values as well
 {
        global $date_system;
     list($day, $month, $year) = explode_date_to_dmy($date);
+
        $months += $year*12+$month;
        $month = ($months-1)%12+1;
        $year = ($months-$month)/12;
-       if ($month < 0)
-               $month += 12;
 
        $timet = mktime(0,0,0, $month, min($day, days_in_month($month, $year)), $year);