From 3092adbb18185f624f24ec4919d48411d08e07c4 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 24 May 2015 14:15:39 +0100 Subject: [PATCH] Minor fixes and docblock changes --- Classes/PHPExcel/Shared/Date.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index 00aefab3..a0a4e395 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -78,8 +78,8 @@ class PHPExcel_Shared_Date /** * Set the Excel calendar (Windows 1900 or Mac 1904) * - * @param integer $baseDate Excel base date (1900 or 1904) - * @return boolean Success or failure + * @param integer $baseDate Excel base date (1900 or 1904) + * @return boolean Success or failure */ public static function setExcelCalendar($baseDate) { @@ -374,6 +374,12 @@ class PHPExcel_Shared_Date return $dateValueNew; } + /** + * Converts a month name (either a long or a short name) to a month number + * + * @param string $month Month name or abbreviation + * @return integer|string Month number (1 - 12), or the original string argument if it isn't a valid month name + */ public static function monthStringToNumber($month) { $monthIndex = 1; @@ -386,11 +392,17 @@ class PHPExcel_Shared_Date return $month; } + /** + * Strips an ordinal froma numeric value + * + * @param string $day Day number with an ordinal + * @return integer|string The integer value with any ordinal stripped, or the original string argument if it isn't a valid numeric + */ public static function dayStringToNumber($day) { $strippedDayValue = (str_replace(self::$numberSuffixes, '', $day)); if (is_numeric($strippedDayValue)) { - return $strippedDayValue; + return (integer) $strippedDayValue; } return $day; }