[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-cvs
Subject: [PEAR-CVS] cvs: pear /Date_Holidays/Holidays Driver.php /Date_Holidays/Holidays/Driver Ireland.php
From: "Ken Guest" <kguest () php ! net>
Date: 2008-01-31 1:07:22
Message-ID: cvskguest1201741642 () cvsserver
[Download RAW message or body]
kguest Thu Jan 31 01:07:22 2008 UTC
Modified files:
/pear/Date_Holidays/Holidays Driver.php
/pear/Date_Holidays/Holidays/Driver Ireland.php
Log:
Bug #13012 move helper methods from Ireland driver to base class
http://cvs.php.net/viewvc.cgi/pear/Date_Holidays/Holidays/Driver.php?r1=1.29&r2=1.30&diff_format=u
Index: pear/Date_Holidays/Holidays/Driver.php
diff -u pear/Date_Holidays/Holidays/Driver.php:1.29 \
pear/Date_Holidays/Holidays/Driver.php:1.30
--- pear/Date_Holidays/Holidays/Driver.php:1.29 Sun Jan 27 13:23:40 2008
+++ pear/Date_Holidays/Holidays/Driver.php Thu Jan 31 01:07:22 2008
@@ -17,13 +17,13 @@
*
* Authors: Carsten Lucke <luckec@tool-garage.de>
*
- * CVS file id: $Id: Driver.php,v 1.29 2008/01/27 13:23:40 kguest Exp $
+ * CVS file id: $Id: Driver.php,v 1.30 2008/01/31 01:07:22 kguest Exp $
*
* @category Date
* @package Date_Holidays
* @author Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
- * @version CVS: $Id: Driver.php,v 1.29 2008/01/27 13:23:40 kguest Exp $
+ * @version CVS: $Id: Driver.php,v 1.30 2008/01/31 01:07:22 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
@@ -35,7 +35,7 @@
* @package Date_Holidays
* @author Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
- * @version CVS: $Id: Driver.php,v 1.29 2008/01/27 13:23:40 kguest Exp $
+ * @version CVS: $Id: Driver.php,v 1.30 2008/01/31 01:07:22 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
@@ -119,7 +119,7 @@
* @subpackage Driver
* @author Carsten Lucke <luckec@tool-garage.de>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
- * @version CVS: $Id: Driver.php,v 1.29 2008/01/27 13:23:40 kguest Exp $
+ * @version CVS: $Id: Driver.php,v 1.30 2008/01/31 01:07:22 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
class Date_Holidays_Driver
@@ -1177,5 +1177,43 @@
if ($days1 > $days2) return 1;
return 0;
}
+ /**
+ * Find the date of the first monday in the specified year of the current year.
+ *
+ * @param integer $month month
+ *
+ * @access private
+ * @return object Date date of first monday in specified month.
+ */
+ function _calcFirstMonday($month)
+ {
+ $date = new Date($this->_year . "-$month-01");
+ while ($date->getDayOfWeek() != 1) {
+ $date = $date->getNextDay();
+ }
+ return ($date);
+ }
+ /**
+ * Find the date of the last monday in the specified year of the current year.
+ *
+ * @param integer $month month
+ *
+ * @access private
+ * @return object Date date of last monday in specified month.
+ */
+ function _calcLastMonday($month)
+ {
+ //work backwards from the first day of the next month.
+ $nm = ((int) $month ) + 1;
+ if ($nm > 12) {
+ $nm = 1;
+ }
+ $date = new Date($this->_year . "-$nm-01");
+ $date = $date->getPrevDay();
+ while ($date->getDayOfWeek() != 1) {
+ $date = $date->getPrevDay();
+ }
+ return ($date);
+ }
}
?>
http://cvs.php.net/viewvc.cgi/pear/Date_Holidays/Holidays/Driver/Ireland.php?r1=1.8&r2=1.9&diff_format=u
Index: pear/Date_Holidays/Holidays/Driver/Ireland.php
diff -u pear/Date_Holidays/Holidays/Driver/Ireland.php:1.8 \
pear/Date_Holidays/Holidays/Driver/Ireland.php:1.9
--- pear/Date_Holidays/Holidays/Driver/Ireland.php:1.8 Fri Jan 25 23:18:37 2008
+++ pear/Date_Holidays/Holidays/Driver/Ireland.php Thu Jan 31 01:07:22 2008
@@ -19,7 +19,7 @@
* @package Date_Holidays
* @author Ken Guest <kguest@php.net>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
- * @version CVS: $Id: Ireland.php,v 1.8 2008/01/25 23:18:37 kguest Exp $
+ * @version CVS: $Id: Ireland.php,v 1.9 2008/01/31 01:07:22 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
@@ -35,7 +35,7 @@
* @subpackage Driver
* @author Ken Guest <kguest@php.net>
* @license http://www.php.net/license/3_01.txt PHP License 3.0.1
- * @version CVS: $Id: Ireland.php,v 1.8 2008/01/25 23:18:37 kguest Exp $
+ * @version CVS: $Id: Ireland.php,v 1.9 2008/01/31 01:07:22 kguest Exp $
* @link http://pear.php.net/package/Date_Holidays
*/
class Date_Holidays_Driver_Ireland extends Date_Holidays_Driver
@@ -91,7 +91,7 @@
*/
$easterDate = Date_Holidays_Driver_Ireland::calcEaster($this->_year);
$this->_addHoliday('easter', $easterDate, 'Easter Sunday');
- $this->_addHoliday('easter', 'ga_IE', 'Domhnach Cásca');
+ $this->_addTranslationForHoliday('easter', 'ga_IE', 'Domhnach Cásca');
/**
* Good Friday / Black Friday
@@ -253,43 +253,5 @@
{
return array('ie', 'irl');
}
- /**
- * A helper method
- *
- * @param integer $month month
- *
- * @access private
- * @return object Date date of first monday in specified month.
- */
- function _calcFirstMonday($month)
- {
- $date = new Date($this->_year . "-$month-01");
- while ($date->getDayOfWeek() != 1) {
- $date = $date->getNextDay();
- }
- return ($date);
- }
- /**
- * A helper method
- *
- * @param integer $month month
- *
- * @access private
- * @return object Date date of last monday in specified month.
- */
- function _calcLastMonday($month)
- {
- //work backwards from the first day of the next month.
- $nm = ((int) $month ) + 1;
- if ($nm > 12) {
- $nm = 1;
- }
- $date = new Date($this->_year . "-$nm-01");
- $date = $date->getPrevDay();
- while ($date->getDayOfWeek() != 1) {
- $date = $date->getPrevDay();
- }
- return ($date);
- }
}
?>
--
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic