public function getWeekOfYear() { if (DATE_CALC_BEGIN_WEEKDAY == 0 && $this->getDayOfWeek() == 0) { $this->addSeconds(86400); $week = parent::getWeekOfYear(); $this->subtractSeconds(86400); return $week; } return parent::getWeekOfYear(); }
/** * Get a Date object for the weekday before this one * * Get a Date object for the weekday before this one. * The time of the returned Date object is the same as this time. * * @access public * @return object Date Date representing the previous weekday */ function getPrevWeekday() { $day = Calc::prevWeekday($this->day, $this->month, $this->year, "%Y-%m-%d"); $date = sprintf("%s %02d:%02d:%02d", $day, $this->hour, $this->minute, $this->second); $newDate = new Date(); $newDate->setDate($date); return $newDate; }