コード例 #1
0
 protected function _buildArray()
 {
     $this->_runner = $this->_from;
     $this->_yearKey = $this->_runner->getYear();
     $this->_monthKey = $this->_runner->getMonth();
     $this->_array[$this->_yearKey] = array();
     while ($this->_runner->format(self::FORMAT_DATE) <= $this->_to) {
         if ($this->_runner->isFirstDayOfMonth()) {
             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->_padDown();
             continue;
         }
         if ($this->_runner->isLastDayOfMonth()) {
             $this->_padUp();
             continue;
         }
         $this->_array[$this->_yearKey][$this->_monthKey][] = $this->_runner->format(self::FORMAT_DATE);
         $this->_runner->addDay();
     }
 }
コード例 #2
0
 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++;
     }
 }