-
Notifications
You must be signed in to change notification settings - Fork 2
Month
Viames Marino edited this page Feb 26, 2026
·
2 revisions
Pair\Html\FormControls\Month renders <input type="month"> with min/max helpers.
min(string|DateTime $minValue): selfmax(string|DateTime $maxValue): selfvalue(string|int|float|DateTime|null $value): staticrender(): string
-
min()andmax()convertDateTimevalues toY-m. -
value(DateTime ...)converts toY-m. - If
Env::get('UTC_DATE')is enabled and value isDateTime, timezone is converted to current user timezone before formatting.
$billingMonth = (new \Pair\Html\FormControls\Month('billingMonth'))
->min('2026-01')
->max('2026-12')
->value('2026-02')
->required();
echo $billingMonth->render();With DateTime:
$period = (new \Pair\Html\FormControls\Month('period'))
->value(new DateTime('2026-08-19 10:30:00'));See also: Date, Datetime, FormControl.