WeeklyCalendarMoment
in package
One weekly release or dispatch moment expressed as ISO weekday and time of day.
Table of Contents
Properties
- $hour : int
- Hour component of the local wall-clock time.
- $isoWeekday : int
- ISO weekday number from 1 (Monday) to 7 (Sunday).
- $minute : int
- Minute component of the local wall-clock time.
- $second : int
- Second component of the local wall-clock time.
Methods
- __construct() : mixed
- Create one weekly calendar moment.
- at() : self
- Build one weekly calendar moment from a weekday name/number and `HH:MM[:SS]` time string.
- clockTime() : string
- Return the canonical local wall-clock string for this moment.
- compareTo() : int
- Compare this moment to another moment using canonical weekday/time ordering.
- dateTime() : DateTimeImmutable
- Resolve this weekly moment into one concrete datetime inside the week that starts at the given Monday midnight.
- signature() : string
- Return a canonical key suitable for deduplication and merges.
- weekday() : int
- Normalize a weekday name or number to ISO weekday form.
- normalizeWeekday() : int
- parseTimeOfDay() : array{int, int, int}
Properties
$hour read-only
Hour component of the local wall-clock time.
public
int
$hour
$isoWeekday read-only
ISO weekday number from 1 (Monday) to 7 (Sunday).
public
int
$isoWeekday
$minute read-only
Minute component of the local wall-clock time.
public
int
$minute
= 0
$second read-only
Second component of the local wall-clock time.
public
int
$second
= 0
Methods
__construct()
Create one weekly calendar moment.
public
__construct(int $isoWeekday, int $hour[, int $minute = 0 ][, int $second = 0 ]) : mixed
Parameters
- $isoWeekday : int
- $hour : int
- $minute : int = 0
- $second : int = 0
Tags
at()
Build one weekly calendar moment from a weekday name/number and `HH:MM[:SS]` time string.
public
static at(int|"mon"|"monday"|"tue"|"tues"|"tuesday"|"wed"|"wednesday"|"thu"|"thur"|"thurs"|"thursday"|"fri"|"friday"|"sat"|"saturday"|"sun"|"sunday" $weekday, string $time) : self
Parameters
- $weekday : int|"mon"|"monday"|"tue"|"tues"|"tuesday"|"wed"|"wednesday"|"thu"|"thur"|"thurs"|"thursday"|"fri"|"friday"|"sat"|"saturday"|"sun"|"sunday"
- $time : string
Return values
selfclockTime()
Return the canonical local wall-clock string for this moment.
public
clockTime() : string
Return values
stringcompareTo()
Compare this moment to another moment using canonical weekday/time ordering.
public
compareTo(self $other) : int
Parameters
- $other : self
Return values
intdateTime()
Resolve this weekly moment into one concrete datetime inside the week that starts at the given Monday midnight.
public
dateTime(DateTimeImmutable $weekStart) : DateTimeImmutable
Parameters
- $weekStart : DateTimeImmutable
Return values
DateTimeImmutablesignature()
Return a canonical key suitable for deduplication and merges.
public
signature() : string
Return values
stringweekday()
Normalize a weekday name or number to ISO weekday form.
public
static weekday(int|string $weekday) : int
Parameters
- $weekday : int|string
Return values
intnormalizeWeekday()
private
static normalizeWeekday(int|string $weekday) : int
Parameters
- $weekday : int|string
Return values
intparseTimeOfDay()
private
static parseTimeOfDay(string $time) : array{int, int, int}
Parameters
- $time : string