Download the PHP package techouse/intl-date-time without Composer
On this page you can find all versions of the php package techouse/intl-date-time. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download techouse/intl-date-time
More information about techouse/intl-date-time
Files in techouse/intl-date-time
Package intl-date-time
Short Description International datepicker field for Laravel Nova.
License MIT
Informations about the package intl-date-time
International DateTime
International datepicker for Laravel Nova
Apply localisation in 71 different locales to Laravel Nova's default DateTime
field that currently doesn't support localisation out of the box.
Installation
You can install the package in to a Laravel app that uses Nova via composer:
Usage
The API is adapted from Nova's default DateTime
Field.
The module itself offers a few optional configurations:
- locale - OPTIONAL - Set the module's locale. If you do not it will automatically use your app's
config('app.locale')
. If you manually define an unsupported locale it will throw an Exception! - dateFormat - OPTIONAL - Set a date format. If you do not provide it the module will automatically use the appropriate locale's date format. The format must be MomentJS compatible!
- timeFormat - OPTIONAL - Set a time format. The format must be MomentJS compatible! If you manually define an unsupported time format it will throw an Exception!
- minDate - OPTIONAL - Set a minimum/earliest date (inclusively) allowed for selection. Has to be an instance of
\DateTime
orCarbon\Carbon
. Defaults tonull
. - maxDate - OPTIONAL - Set a maximum/latest date (inclusively) allowed for selection. Has to be an instance of
\DateTime
orCarbon\Carbon
. Defaults tonull
. - placeholder - OPTIONAL - Set a placeholder. If you do not want a placeholder set it to
false
. - errorMessage - OPTIONAL - Set a custom error message in case of an invalid date format. If you do not set it it will display an error message in the current locale.
- errorMessageLocale - OPTIONAL - Set a custom error message locale. If not set it equals the set
locale
or your app'sconfig('app.locale')
. If you manually define an unsupported locale it will throw an Exception! Here is the list of all supported locales. - hideUserTimeZone - OPTIONAL - When applied hides the user time zone next to the form field. Default is
false
. - withShortcutButtons - OPTIONAL - When applied shows the user 3 shortcut buttons for 'yesterday, 'today' and 'tomorrow' below the calendar. The buttons are all in English and in order to translate them please edit your language JSON file in the directory
resources/lang/vendor/nova
. - withTime - OPTIONAL - Shortcut for displaying the full locale time, e.g. HH:mm:ss. NOTE: The timeFormat option has precedence over withTime.
- withTimeShort - OPTIONAL - Shortcut for displaying the short locale time, e.g. HH:mm. NOTE: The timeFormat option has precedence over withTimeShort.
- userTimeZone - OPTIONAL - Define custom Timezone for specific field - by default Nova.config.userTimezone is used.
Simply use IntlDateTime
class instead of DateTime
directly or alias it like the example below so you won't have to refactor too much existing code.
Programmed filling
Like many Laravel Nova Fields, this field implement the programmed filling. You can emit a Laravel Nova javascript event in order to fill the field in the update form.
Please make sure that the value emitted correspond to your local date.
List of supported locales
This module supports only locales that are SUPPORTED BY BOTH MomentJS AND Flatpickr!
The 71 locales that are currently supported are:
Language | locale |
---|---|
Albanian | sq |
Arabic | ar |
Azerbaijani | az |
Bangla | bn |
Belarusian | be |
Bosnian | bs |
Bulgarian | bg |
Burmese | my |
Catalan | ca |
Chinese (China) | zh-cn |
Chinese (Hong Kong) | zh-hk |
Chinese (Taiwan) | zh-tw |
Croatian | hr |
Czech | cs |
Danish | da |
Dutch | nl |
English | en |
English (Australia) | en-au |
English (Canada) | en-ca |
English (Ireland) | en-ie |
English (New Zealand) | en-nz |
English (United Kingdom) | en-gb |
Esperanto | eo |
Estonian | et |
Faroese | fo |
Finnish | fi |
French | fr |
French (Canada) | fr-ca |
French (Switzerland) | fr-ch |
Georgian | ka |
German | de |
German (Austria) | de-at |
German (Switzerland) | de-ch |
Greek | el |
Hebrew | he |
Hindi | hi |
Hungarian | hu |
Indonesian | id |
Icelandic | is |
Irish Gaelic | ga |
Italian | it |
Japanese | ja |
Kazakh | kk |
Khmer | km |
Korean | ko |
Latvian | lv |
Lithuanian | lt |
Macedonian | mk |
Malaysian | ms |
Mongolian | mn |
Norwegian | nb |
Persian | fa |
Polish | pl |
Portuguese | pt |
Portuguese (Brazil) | pt-br |
Punjabi | pa-in |
Romanian | ro |
Russian | ru |
Serbian | sr |
Serbian (Cyrillic) | sr-cyrl |
Sinhala | si |
Slovak | sk |
Slovenian | sl |
Spanish | es |
Spanish (Dominican Republic) | es-do |
Spanish (United States) | es-us |
Swedish | sv |
Thai | th |
Turkish | tr |
Ukrainian | uk |
Vietnamese | vi |
Welsh | cy |
NOTE
This an evolution of my original Slovenian DateTime
All versions of intl-date-time with dependencies
illuminate/support Version ^5.6 || ^6.0 || ^7.0 || ^8.0 || ^9.0
laravel/nova Version *