src/Ical/Component/Event.php
public function on(DateTime $on) {
        if ($on->format('His') !== '000000') {
            throw new RuntimeException('One day events must start at midnight');
        }

        $fin = clone $on;
        $fin->add(new \DateInterval('P1D'));

        $this->start($on)
                ->end($fin)
                ->allDay(true);

        return $this;
    }
public function on(DateTime $on) {
        if ($on->format('His') !== '000000') {
            throw new RuntimeException('One day events must start at midnight');
        }

        $fin = clone $on;
        $fin->add(new \DateInterval('P1D'));

        $this->start($on)
                ->end($fin)
                ->allDay(true);

        return $this;
    }
public function on ( DateTime $ on ) { if ( $ on -> format ( 'His' ) !== '000000' ) { throw new RuntimeException ( 'One day events must start at midnight' ) ; } $ fin = clone $ on ; $ fin -> add ( new \ DateInterval ( 'P1D' ) ) ; $ this -> start ( $ on ) -> end ( $ fin ) -> allDay ( true ) ; return $ this ; }
One day helper
Sets event to a single day

@param \DateTime $on
@return \Ical\Component\Event
One day helper Sets event to a single day