/** * Function to check if the given time falls between starttime and stoptime of the current starsign * @param \System\Calendar\Time the time to check * @return boolean indicating if the given time falls betwqeen starttime and stoptime of the current starsign */ protected final function containsDate(\System\Calendar\Time $time) { return $time->getMonth() == $this->startTime->getMonth() && $time->GetDay() >= $this->startTime->getDay() || $time->getMonth() == $this->stopTime->getMonth() && $time->getDay() <= $this->stopTime->getDay(); }
/** * Returns the amount of days until the next birthday. * @param \System\Calendar\Time The date of birth * @return int The amount of days */ public static final function getDaysUntilBirthday(\System\Calendar\Time $birthday) { $thisYearBirthday = new \System\Calendar\Time(date('Y'), $birthday->getMonth(), $birthday->getDay()); $nextYearBirthday = new \System\Calendar\Time(date('Y') + 1, $birthday->getMonth(), $birthday->getDay()); $today = self::getCurrentTime(); $countDown = $nextYearBirthday; if ($today->compare($thisYearBirthday) == \System\Math\Math::COMPARE_LESSTHAN || $today->compare($thisYearBirthday) == \System\Math\Math::COMPARE_EQUAL) { $countDown = $thisYearBirthday; } $diff = $countDown->toUNIX() - $today->toUNIX(); return ceil($diff / \System\Calendar\Time::SECONDS_IN_DAY); }