Exemplo n.º 1
0
 public function testGetSetIsOverflow()
 {
     $d = new Day(new DateTime('2014-04-16'));
     $this->assertFalse($d->isOverflow());
     $d->setIsOverflow(true);
     $this->assertTrue($d->isOverflow());
 }
Exemplo n.º 2
0
 /**
  * Returns the days in this week.
  *
  * @return  Day[]
  */
 public function days()
 {
     if (!isset($this->days)) {
         $clonedStart = clone $this->weekStart;
         $this->days = array();
         for ($i = 0; $i < 7; $i++) {
             $thisDay = new Day($clonedStart);
             if ($this->containingMonth && $this->containingMonth->firstDay()->format('m') != $clonedStart->format('m')) {
                 $thisDay->setIsOverflow(true);
             }
             $this->days[] = $thisDay;
             $clonedStart->modify('+1 day');
         }
     }
     return $this->days;
 }