protected function _padUp() { $start = $this->_runner->format(self::FORMAT_DATE); $end = $this->_runner->ceil(CalendarDateTime::W)->format(self::FORMAT_DATE); $this->_runner->modify($start); while ($this->_runner->format(self::FORMAT_DATE) <= $end) { $this->_array[$this->_yearKey][$this->_monthKey][] = $this->_runner->format(self::FORMAT_DATE); $this->_runner->addDay(); } $this->_runner->modify($start)->addDay(); }
protected function _buildArray() { $this->_runner = $this->_from; $this->_yearKey = $this->_runner->getYear(); $this->_monthKey = $this->_runner->getMonth(); $this->_array[$this->_yearKey] = array(); $dayIndex = $this->_runner->getDay() - 1; while ($this->_runner->format(self::FORMAT_DATE) <= $this->_to) { if ($this->_runner->isFirstDayOfMonth()) { $dayIndex = $this->_runner->getDay() - 1; if ($this->_runner->isFirstDayOfYear()) { $this->_yearKey = $this->_runner->getYear(); $this->_array[$this->_yearKey] = array(); } $this->_monthKey = $this->_runner->getMonth(); $this->_array[$this->_yearKey][$this->_monthKey] = array(); } $this->_array[$this->_yearKey][$this->_monthKey][$dayIndex] = $this->_runner->format(self::FORMAT_DATE); $this->_runner->addDay(); $dayIndex++; } }