Configuration
Below is the full configuration available with defaults values:
"example" => [
"type" => "anomaly.field_type.datetime",
"config" => [
"default_value" => null,
"mode" => "datetime",
"date_format" => "j F, Y",
"year_range" => "-50:+50",
"time_format" => "g:i A",
"timezone" => null,
"picker" => true,
"step" => 15,
"min" => null,
"max" => null
]
]
Configuration
Key | Example | Description |
---|---|---|
default |
|
The default value. |
mode |
time |
The input mode. Valid options are |
date_format |
|
A PHP date format. Only used in |
year_range |
|
A range of valid years to choose from. |
time_format |
|
A PHP date format. Only used in |
timezone |
|
The timezone for the input and output. Defaults to system configured timezone. |
picker |
|
Enables and disables the datetime picker UI. |
step |
30 |
The minute step detail. Only used in |
min |
-1w |
A valid number or string option accepted by jQuery Datepicker |
max |
+1w |
A valid number or string option accepted by jQuery Datepicker |
Addon Configuration
The datetime configuration options are controlled by the field type's formats.php
configuration file.
You can override these options by publishing the addon and modifying the resulting configuration file:
php artisan addon:publish anomaly.field_type.datetime
The field type will be published to /resources/{application}/addons/anomaly/datetime-field_type
.
If you have options to add or have found an error, submit a pull request to https://github.com/anomalylabs/datetime-field_type{.callout}