__construct( DateTime $begin, DateTime $end, int $firstWeekday = Day::MONDAY) | ||
DateTime | getBegin() | from PeriodAbstract |
DateTime | getEnd() | from PeriodAbstract |
bool |
contains( DateTime $date)
Checks if the given period is contained in the current period |
from PeriodAbstract |
bool |
equals( PeriodInterface $period)
Checks if a period is equals to an other |
from PeriodAbstract |
bool |
includes( PeriodInterface $period, bool $strict = true)
Returns true if the period include the other period given as argument |
from PeriodAbstract |
boolean |
containsEvent( EventInterface $event)
Returns if $event is during this period. |
from PeriodAbstract |
string |
format( string $format)
Format the period to a string |
from PeriodAbstract |
bool |
isCurrent()
Returns if the current period is the current one |
from PeriodAbstract |
Day | getNext() | |
Day | getPrevious() | |
setFirstWeekday( int $firstWeekday) | from PeriodAbstract | |
int | getFirstWeekday() | from PeriodAbstract |
static bool | isValid( DateTime $start) | |
DatePeriod |
getDatePeriod()
Returns the period as a DatePeriod |
|
static DateInterval |
getDateInterval()
Returns a \DateInterval equivalent to the period |
public
__construct( DateTime $begin, DateTime $end, int $firstWeekday = Day::MONDAY)
Parameters |
|
---|
public DateTime
getBegin()
public DateTime
getEnd()
public bool
contains( DateTime $date)
Checks if the given period is contained in the current period
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public bool
equals( PeriodInterface $period)
public bool
includes( PeriodInterface $period, bool $strict = true)
Returns true if the period include the other period given as argument
Parameters |
|
||||||
---|---|---|---|---|---|---|---|
Return Value |
|
public boolean
containsEvent( EventInterface $event)
Returns if $event is during this period.
Non strict. Must return true if : * Event is during period * Period is during event * Event begin is during Period * Event end is during Period
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public string
format( string $format)
Format the period to a string
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public bool
isCurrent()
Returns if the current period is the current one
Return Value |
|
---|
public Day
getNext()
public Day
getPrevious()
public
setFirstWeekday( int $firstWeekday)
Parameters |
|
---|
public int
getFirstWeekday()
Return Value |
|
---|
static public bool
isValid( DateTime $start)
Parameters |
|
|||
---|---|---|---|---|
Return Value |
|
public DatePeriod
getDatePeriod()
static public DateInterval
getDateInterval()
Returns a \DateInterval equivalent to the period
Return Value |
|
||
---|---|---|---|
Exceptions |
|