From be368a82f789aaa9f0ac0c8b6fa72a2f7cd0b6d4 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 20 Feb 2014 15:46:05 +0200 Subject: Date helper days_in_month(), CI_Calendar::get_total_days() changes - days_in_month() now uses cal_days_in_month(), if available. - CI_Calendar::get_total_days() is now an alias for days_in_month(). --- system/helpers/date_helper.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'system/helpers/date_helper.php') diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index 56e5c46aa..73fd8086e 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -278,6 +278,11 @@ if ( ! function_exists('days_in_month')) $year = date('Y'); } + if (defined('CAL_GREGORIAN')) + { + return cal_days_in_month(CAL_GREGORIAN, $month, $year); + } + if ($year >= 1970) { return (int) date('t', mktime(12, 0, 0, $month, 1, $year)); -- cgit v1.2.3-24-g4f1b