# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/dzolo/Projects/FreenetIS/freenetis-stable # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: application/helpers/date.php --- application/helpers/date.php Base (BASE) +++ application/helpers/date.php Locally Modified (Based On LOCAL) @@ -528,8 +528,34 @@ // returns boundary date of month return date('Y-m-d', mktime(0, 0, 0, $month, $deduct_day2, $year)); } - - /** + + /** + * Function returns next date of deduct from the given date. + * Next means that next mmonth deduct date is calculated. + * + * @author Ondřej Fibich + * @since 1.1.10 + * + * @param string $date input deduct date + * @return string next deduct date from next month + */ + public static function get_next_deduct_date_to($date) + { + $d_arr = date_parse($date); + // increase month + $d_arr['month']++; + if ($d_arr['month'] > 12) + { + $d_arr['month'] = 1; + $d_arr['year']++; + } + // get deduct day for increased month + $d_arr['day'] = date::get_deduct_day_to($d_arr['month'], $d_arr['year']); + // create new date + return date::create($d_arr['day'], $d_arr['month'], $d_arr['year']); + } + + /** * Calculate deduct day of given month. * * @author Ondrej Fibich @@ -965,65 +991,5 @@ $timestamp = mktime(0, 0, 0, $month, $day, $year); return date('Y-m-d', $timestamp); } - - /** - * Performs arithmetic on date - * - * @author Michal Kliment - * @param integer $day - * @param integer $month - * @param integer $year - * @param string $unit - * @param integer $number - * @return type - */ - public static function arithmetic_arr(&$day, &$month, &$year, $unit, $number) - { - if ($unit != 'day' && $unit != 'month' && $unit != 'year') - return; - - $$unit += $number; - - $middle = date::get_deduct_day_to($month, $year); - - $year += floor($month/12); - $month = ($month %12 + 12) % 12; - - if ($month == 0) - { - $month = 12; - $year--; - } - - while ($day <= 0) - { - date::arithmetic_arr($middle, $month, $year, 'month', -1); - $day += date::days_of_month($month, $year); - } - - while ($day > date::days_of_month($month, $year)) - { - $day -= date::days_of_month($month, $year); - date::arithmetic_arr($middle, $month, $year, 'month', 1); - } - } - - /** - * Performs arithmetic on date - * Silimar to arithmetic_arr, but returns string - * - * @param string $date - * @param string $unit - * @param integer $number - * @return type - */ - public static function arithmetic($date, $unit, $number = 1) - { - $pd = date_parse($date); - - date::arithmetic_arr($pd['day'], $pd['month'], $pd['year'], $unit, $number); - - return date('Y-m-d', mktime(0, 0, 0, $pd['month'], $pd['day'], $pd['year'])); - } } // End date Index: application/vendors/unit_tester/unit_testing_config.xml --- application/vendors/unit_tester/unit_testing_config.xml Base (BASE) +++ application/vendors/unit_tester/unit_testing_config.xml Locally Modified (Based On LOCAL) @@ -16004,32 +16004,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -