Ejemplo n.º 1
0
 /**
  * Return true if the given year is a leap year. Determination of whether a 
  * year is a leap year is actually very complicated. We do something crude 
  * and mostly correct here, but for a real determination you need a lot of 
  * contextual information. For example, in Sweden, the change from Julian to 
  * Gregorian happened in a complex way resulting in missed leap years and 
  * double leap years between 1700 and 1753. Another example is that after the 
  * start of the Julian calendar in 45 B.C., the leap years did not regularize
  * until 8 A.D. This method ignores these quirks, and pays attention only to 
  * the Julian onset date and the Gregorian cutover (which can be changed).
  *
  * @param      int  The given year.
  *
  * @return     bool if the given year is a leap year; false otherwise.
  * 
  * @author     Dominik del Bondio <*****@*****.**>
  * @author     The ICU Project
  * @since      0.11.0
  */
 public function isLeapYear($year)
 {
     // MSVC complains bitterly if we try to use Grego::isLeapYear here
     // NOTE: year&0x3 == year%4
     return $year >= $this->fGregorianCutoverYear ? AgaviCalendarGrego::isLeapYear($year) : ($year & 0x3) == 0;
     // Julian
 }