PHPackages                             techouse/intl-date-time - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. techouse/intl-date-time

AbandonedArchivedLibrary[Localization &amp; i18n](/categories/localization)

techouse/intl-date-time
=======================

International datepicker field for Laravel Nova.

v1.7.0(4y ago)57211.9k↓34.1%22[1 issues](https://github.com/techouse/intl-date-time/issues)MITVuePHP &gt;=7.1.0

Since Feb 3Pushed 4y ago3 watchersCompare

[ Source](https://github.com/techouse/intl-date-time)[ Packagist](https://packagist.org/packages/techouse/intl-date-time)[ RSS](/packages/techouse-intl-date-time/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (62)Used By (0)

International DateTime
======================

[](#international-datetime)

[![Latest Version on Packagist](https://camo.githubusercontent.com/454e099e7e80b1c353bae5cccf6f26175b9c4329e42d8b23d0ac10a9708e0e97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746563686f7573652f696e746c2d646174652d74696d652e7376673f7374796c653d666c6174)](https://packagist.org/packages/techouse/intl-date-time)[![Total Downloads](https://camo.githubusercontent.com/d020e4ca13ff24b7f87e2f49ccf01ef8f720ec83129172cd606a942971ac81ec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746563686f7573652f696e746c2d646174652d74696d652e7376673f7374796c653d666c6174)](https://packagist.org/packages/techouse/intl-date-time)[![Licence](https://camo.githubusercontent.com/1a9e2f91b1ea3875f67fd678e757458a463998213d9088b37c8fee9e610613a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746563686f7573652f696e746c2d646174652d74696d652e737667)](https://packagist.org/packages/techouse/intl-date-time)[![PHP version](https://camo.githubusercontent.com/ee587057aadce4f3514d2626dc31837c9001adca9b036e7db68be4641faab8da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746563686f7573652f696e746c2d646174652d74696d652f6465762d6d61737465722e737667)](https://packagist.org/packages/techouse/intl-date-time)[![Codacy Badge](https://camo.githubusercontent.com/36f53031a45e2c522449f09e2397c7b2b37468994faa8a80aefe7aadb68d17f0/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3365646462616433353661323431636261363332666437306433623939316530)](https://www.codacy.com/manual/techouse/intl-date-time?utm_source=github.com&utm_medium=referral&utm_content=techouse/intl-date-time&utm_campaign=Badge_Grade)[![GitHub stars](https://camo.githubusercontent.com/467f9304eda7244e5ba80c84b431c27ba96ef02042ae8541b3942dd46e64f40c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f746563686f7573652f696e746c2d646174652d74696d652e7376673f7374796c653d736f6369616c266c6162656c3d53746172266d61784167653d32353932303030)](https://github.com/techouse/intl-date-time/stargazers)

##### International datepicker for Laravel Nova

[](#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.

[![International DateTime](./screenshot.png)](./screenshot.png)

Installation
------------

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require techouse/intl-date-time
```

Usage
-----

[](#usage)

The API is adapted from [Nova's default `DateTime` Field](https://nova.laravel.com/docs/1.0/resources/fields.html#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](https://momentjs.com/docs/#/displaying/format/)!
- **timeFormat** - *OPTIONAL* - Set a time format. The format must be [MomentJS compatible](https://momentjs.com/docs/#/displaying/format/)! 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` or `Carbon\Carbon`. Defaults to `null`.
- **maxDate** - *OPTIONAL* - Set a maximum/latest date (inclusively) allowed for selection. Has to be an instance of `\DateTime` or `Carbon\Carbon`. Defaults to `null`.
- **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's `config('app.locale')`. If you manually define an unsupported locale it will throw an Exception! [Here is the list of all supported locales](https://github.com/baianat/vee-validate/tree/master/locale).
- **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.

```
