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().
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 56e5c46..73fd808 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -278,6 +278,11 @@
$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));