Repository navigation
Date
Viames Marino edited this page Feb 26, 2026
·
2 revisions
Pair\Html\FormControls\Date renders date inputs with formatting and min/max helpers.
dateFormat(string $format): selfmin(string|DateTime $minValue): selfmax(string|DateTime $maxValue): selfvalue(string|int|float|DateTime|null $value): staticrender(): string
- Default format is
Y-m-d. - If
Post::usingCustomDatepicker()and translation keyFORM_DATE_FORMATexists, constructor switches to translated format. -
min()andmax()accept string orDateTimeand outputY-m-dwhenDateTimeis used. - If
Env::get('UTC_DATE')is enabled and value isDateTime, value is converted to user timezone before formatting.
Native date input with explicit range:
$start = (new \Pair\Html\FormControls\Date('startDate'))
->min('2026-01-01')
->max('2026-12-31')
->value('2026-02-15')
->required();Using DateTime values:
$checkin = (new \Pair\Html\FormControls\Date('checkin'))
->value(new DateTime('2026-03-10 14:00:00'))
->min(new DateTime('2026-01-01'))
->max(new DateTime('2026-12-31'));For native <input type="date">, the rendered value should stay browser-compatible (YYYY-MM-DD).
See also: Datetime, Month, Time, FormControl.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4