Time - viames/pair GitHub Wiki
Pair framework: Time
Pair\Html\FormControls\Time renders <input type="time"> with min/max helpers.
Methods
min(string|DateTime $minValue): selfmax(string|DateTime $maxValue): selfvalue(string|int|float|DateTime|null $value): staticrender(): string
Behavior
- String values are stored as-is (typically
HH:MMorHH:MM:SS). value(DateTime ...)formats toH:i.- If
Env::get('UTC_DATE')is enabled and value isDateTime, timezone is converted to current user timezone.
Example
$meeting = (new \Pair\Html\FormControls\Time('meetingTime'))
->min('09:00')
->max('18:00')
->value('10:30')
->required();
echo $meeting->render();
Using DateTime:
$slot = (new \Pair\Html\FormControls\Time('slot'))
->value(new DateTime('2026-02-26 14:45:00'));
Notes
For min() and max(), when passing a DateTime object, current implementation formats it as Y-m-d instead of H:i.
For predictable output, prefer passing string time values.
See also: Date, Datetime, FormControl.