https://github.com/techouse/slovenian-date-time
Slovenian datepicker for Laravel Nova
https://github.com/techouse/slovenian-date-time
laravel laravel-nova php vue
Last synced: 5 months ago
JSON representation
Slovenian datepicker for Laravel Nova
- Host: GitHub
- URL: https://github.com/techouse/slovenian-date-time
- Owner: techouse
- License: mit
- Archived: true
- Created: 2018-10-20T12:59:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-03T14:54:03.000Z (over 7 years ago)
- Last Synced: 2025-08-01T19:04:06.757Z (10 months ago)
- Topics: laravel, laravel-nova, php, vue
- Language: Vue
- Size: 108 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slovenian DateTime
[](https://packagist.org/packages/techouse/slovenian-date-time)
[](https://packagist.org/packages/techouse/slovenian-date-time)
##### Slovenian datepicker for Laravel Nova
Apply Slovenian localisation 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](https://nova.laravel.com) via composer:
```bash
composer require techouse/slovenian-date-time
```
## Usage
The API is exactly the same as with [Nova's default `DateTime` Field](https://nova.laravel.com/docs/1.0/resources/fields.html#datetime-field)
Simply use `SlovenianDateTime` class instead of `DateTime` directly or alias it like the example below so you won't have to refactor too much existing code.
```php
sortable(),
Text::make(__('Name'), 'name')
->sortable()
->rules('required', 'max:255'),
Text::make(__('Email Address'), 'email')
->sortable()
->rules('required', 'email', 'max:254')
->creationRules('unique:users,email')
->updateRules('unique:users,email,{{resourceId}}'),
Password::make(__('Password'), 'password')
->onlyOnForms()
->creationRules('required', 'string', 'min:6')
->updateRules('nullable', 'string', 'min:6'),
DateTime::make(__('Created at'), 'created_at')
->format('DD.MM.YYYY HH:mm:ss')
->creationRules('required', 'date')
->sortable(),
DateTime::make(__('Updated at'), 'updated_at')
->format('DD.MM.YYYY HH:mm:ss')
->updateRules('required', 'date')
->hideFromIndex(),
];
}
/**
* Get the cards available for the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function cards(Request $request)
{
return [];
}
/**
* Get the filters available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function filters(Request $request)
{
return [];
}
/**
* Get the lenses available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function lenses(Request $request)
{
return [];
}
/**
* Get the actions available for the resource.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function actions(Request $request)
{
return [];
}
}
```
#### NOTE
If you need a different language than Slovenian you can check out my [International DateTime](https://github.com/techouse/intl-date-time) for Laravel Nova.