When\When::startDate PHP Method

startDate() public method

public startDate ( $startDate )
    public function startDate($startDate)
    {
        if (Valid::dateTimeObject($startDate)) {
            $this->startDate = clone $startDate;
            return $this;
        }
        throw new \InvalidArgumentException("startDate: Accepts valid DateTime objects");
    }

Usage Example

Ejemplo n.º 1
0
 function testGetPrevOccurrenceFromFirstOccurence()
 {
     $r = new When();
     $r->startDate(new DateTime("19970902T090000"))->rrule("FREQ=WEEKLY")->until(new DateTime("19971104T090000"));
     $result = $r->getPrevOccurrence(new DateTime("19970902T090000"));
     $this->assertFalse($result);
 }
All Usage Examples Of When\When::startDate