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));
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index 23c389e..7bdcdca 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -456,23 +456,8 @@
 	 */
 	public function get_total_days($month, $year)
 	{
-		$days_in_month	= array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
-
-		if ($month < 1 OR $month > 12)
-		{
-			return 0;
-		}
-
-		// Is the year a leap year?
-		if ($month == 2)
-		{
-			if ($year % 400 === 0 OR ($year % 4 === 0 && $year % 100 !== 0))
-			{
-				return 29;
-			}
-		}
-
-		return $days_in_month[$month - 1];
+		$this->load->helper('date');
+		return days_in_month($month, $year);
 	}
 
 	// --------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index ccbb950..a3e7980 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -65,11 +65,12 @@
 
    -  :doc:`Date Helper <helpers/date_helper>` changes include:
 
-      - :func:`now()` now works with all timezone strings supported by PHP.
       - Added an optional third parameter to :func:`timespan()` that constrains the number of time units displayed.
       - Added an optional parameter to :func:`timezone_menu()` that allows more attributes to be added to the generated select tag.
-      - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <http://www.php.net/manual/en/class.datetime.php#datetime.constants.types>`_.
       - Added function :func:`date_range()` that generates a list of dates between a specified period.
+      - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants <http://www.php.net/manual/en/class.datetime.php#datetime.constants.types>`_.
+      - Changed :func:`now()` to work with all timezone strings supported by PHP.
+      - Changed :func:`days_in_month()` to use the native ``cal_days_in_month()`` PHP function, if available.
 
    -  :doc:`URL Helper <helpers/url_helper>` changes include:
 
@@ -301,6 +302,7 @@
       -  Added configuration to generate days of other months instead of blank cells.
       -  Added auto-configuration for *next_prev_url* if it is empty and *show_prev_next* is set to TRUE.
       -  Added support for templating via an array in addition to the encoded string.
+      -  Changed method ``get_total_days()`` to be an alias for :doc:`Date Helper <helpers/date_helper>` :func:`days_in_month()`.
 
    -  :doc:`Cart Library <libraries/cart>` changes include:
 
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
index 39a9cb3..d9019a2 100644
--- a/user_guide_src/source/helpers/date_helper.rst
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -268,6 +268,9 @@
 
 	If the second parameter is empty, the current year will be used.
 
+	.. note:: This function will alias the native ``cal_days_in_month()``, if
+		it is available.
+
 .. function:: date_range([$unix_start = ''[, $mixed = ''[, $is_unix = TRUE[, $format = 'Y-m-d']]]])
 
 	:param	int	$unix_start: UNIX timestamp of the range start date
diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst
index b4f95db..2083274 100644
--- a/user_guide_src/source/libraries/calendar.rst
+++ b/user_guide_src/source/libraries/calendar.rst
@@ -286,6 +286,9 @@
 			echo $this->calendar->get_total_days(2, 2012);
 			// 29
 
+		.. note:: This method is an alias for :doc:`Date Helper
+			<../helpers/date_helper>` function :func:`days_in_month()`.
+
 	.. method:: default_template()
 
 		:returns:	An array of template values