SlotFlow API Documentation

WeeklyCalendarMoment
in package

FinalYes

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

$isoWeekday read-only

ISO weekday number from 1 (Monday) to 7 (Sunday).

public int $isoWeekday

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
throws
SlotFlowInvalidArgumentException

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
self

clockTime()

Return the canonical local wall-clock string for this moment.

public clockTime() : string
Return values
string

compareTo()

Compare this moment to another moment using canonical weekday/time ordering.

public compareTo(self $other) : int
Parameters
$other : self
Return values
int

dateTime()

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
DateTimeImmutable

signature()

Return a canonical key suitable for deduplication and merges.

public signature() : string
Return values
string

weekday()

Normalize a weekday name or number to ISO weekday form.

public static weekday(int|string $weekday) : int
Parameters
$weekday : int|string
Return values
int

normalizeWeekday()

private static normalizeWeekday(int|string $weekday) : int
Parameters
$weekday : int|string
Return values
int

parseTimeOfDay()

private static parseTimeOfDay(string $time) : array{int, int, int}
Parameters
$time : string
Return values
array{int, int, int}

        
On this page

Search results