SPHPlayground API
SPHPlayground
sphplayground sphplayground

Calendar units

CalendarUnit has two enumeration implementations. These Enumerations localize weekday and month names. Implemented calendar unit instances can translate its name to various language by using IntlDateFormatter.

The Weekday enumeration

Weekday enumeration is used to specify an association between a weekday name and a weekday number.

Synopsis
enum Weekday: int implements CalendarUnit
case Monday = 1
case Tuesday = 2
case Wednesday = 3
case Thursday = 4
case Friday = 5
case Saturday = 6
case Sunday = 7
public jsonSerialize():object
Returns the name or an abbreviation of the weekday
public abbreviation(?int $length = null, ?string $locale = null):string

The Month enumeration

Month enumeration is used to specify an association between month name and a month number.

Synopsis
enum Month: int implements CalendarUnit
case January = 1
case February = 2
case March = 3
case April = 4
case May = 5
case June = 6
case July = 7
case August = 8
case September = 9
case October = 10
case November = 11
case December = 12
public jsonSerialize():object
Returns the name or an abbreviation of the month
public abbreviation(?int $length = null, ?string $locale = null):string