-
Notifications
You must be signed in to change notification settings - Fork 2
Time
Viames Marino edited this page Feb 26, 2026
·
2 revisions
Pair\Html\FormControls\Time renders <input type="time"> with min/max helpers.
min(string|DateTime $minValue): selfmax(string|DateTime $maxValue): selfvalue(string|int|float|DateTime|null $value): staticrender(): string
- 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.
$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'));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.