TimePicker
Custom time selection control with scrollable hour and minute columns. The picker UI can display in 24-hour or 12-hour AM/PM mode. The ->format() option controls what value is written to the input (and submitted to the server). Default format is H:i (24-hour HH:MM).
Basic TimePicker
With Pre-populated Value & Now Button
30-Minute Step Intervals
12-Hour AM/PM Mode — ->ampm()
Use ->ampm() to switch the picker UI to 12-hour mode with an AM/PM column. The output format is independent — combine with ->format() to control what value gets submitted.
Custom Format Output — ->format()
Format tokens (PHP date-style): H 24-hr with zero, G 24-hr without zero, h 12-hr with zero, g 12-hr without zero, i minutes, A AM/PM, a am/pm.
Disabled
Select a time to see the value…
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->timepicker($id) | string | Create a TimePicker component. |
->value($value) | ?string | Set the initial value. Accepts 24-hour 'HH:MM', 'HH:MM:SS', or a 12-hour 'h:mm AM' string. Pass null or empty string to clear. |
->name($name) | string | Form field name attribute. |
->placeholder($text) | string | Placeholder text shown when no time is selected. Default: 'Select time…'. |
->step($minutes) | int | Minute step interval — must be a divisor of 60 (e.g. 5, 10, 15, 30). Default: 15. |
->showNowButton($show) | bool | Show a "Now" footer button that snaps to the current time. Default: false. |
->ampm($use) | bool | Switch the picker UI to 12-hour AM/PM mode. Shorthand for ->use24Hour(false). Default: false (24-hour UI). |
->use24Hour($use) | bool | Display times in 24-hour format. Default: true. Pass false for 12-hour AM/PM mode. |
->format($fmt) | string | Output format written to the input and submitted to the server. Tokens: H (24h+zero), G (24h), h (12h+zero), g (12h), i (minutes), A (AM/PM), a (am/pm). Default: 'H:i'. |
->disabled($dis) | bool | Disable the timepicker. Default: false. |
JS JS Methods
| Method / Property | Parameters | Description |
|---|---|---|
m.timepicker(id) | string | Get (or create) TimePicker instance. Returns cached instance on subsequent calls. |
value() | | Get the current value in the configured output format (default 'HH:MM'), or '' if empty. |
value(val) | string | Set the value. Accepts 24-hour 'HH:MM' or 12-hour 'h:mm AM' format. Writes to the input using the configured data-format. |
clear() | | Clear the selected time. |
enable() | | Enable the timepicker. |
disable() | | Disable the timepicker and close the panel. |
EVENT Events
| Event Name | Detail | Description |
|---|---|---|
m:timepicker:change | { value: string } | Fired on the hidden input element whenever the selected time changes (including when cleared). detail.value is the new value in the configured output format, or empty string. |
TimePicker
Custom time selection control with scrollable hour and minute columns. Stores values in 24-hour HH:MM format and supports 12-hour AM/PM display mode.
Basic TimePicker
With Pre-populated Value & Now Button
30-Minute Step Intervals
12-Hour AM/PM Mode
Disabled
Select a time to see the value...
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->timepicker($id) | string | Create a TimePicker component. |
->value($value) | ?string | Set the initial value in 24-hour HH:MM format (e.g. '14:30'). Pass null or empty string to clear. |
->name($name) | string | Form field name attribute. |
->placeholder($text) | string | Placeholder text shown when no time is selected. Default: 'Select time\u2026'. |
->step($minutes) | int | Minute step interval — must be a divisor of 60 (e.g. 5, 10, 15, 30). Default: 15. |
->showNowButton($show) | bool | Show a "Now" footer button that snaps to the current time. Default: false. |
->use24Hour($use) | bool | Display times in 24-hour format. Default: true. Pass false for 12-hour AM/PM mode. |
->disabled($dis) | bool | Disable the timepicker. Default: false. |
JS JS Methods
| Method / Property | Parameters | Description |
|---|---|---|
m.timepicker(id) | string | Get (or create) TimePicker instance. Returns cached instance on subsequent calls. |
value() | | Get the current value as a 'HH:MM' string, or '' if empty. |
value(val) | string | Set the value. Pass a 24-hour 'HH:MM' string, or '' to clear. |
clear() | | Clear the selected time. |
enable() | | Enable the timepicker. |
disable() | | Disable the timepicker and close the panel. |
EVENT Events
| Event Name | Detail | Description |
|---|---|---|
m:timepicker:change | { value: string } | Fired on the hidden input element whenever the selected time changes (including when cleared). detail.value is the new HH:MM string or empty string. |