mziraki/nova-persian-date-field

Laravel Nova Jalali/Persian Date/DateTime field.

Installs: 11 799

Dependents: 1

Suggesters: 0

Security: 0

Stars: 4

Watchers: 1

Forks: 2

Language:Vue

v1.1 2023-04-17 08:34 UTC

This package is auto-updated.

Last update: 2024-12-11 19:01:13 UTC


README

A persian/jalali date/datetime resource field for Laravel Nova

Requirements

  • php: ^8.0
  • laravel/nova: ^4.0

Installation

Install the package into a Laravel app that uses Nova with Composer:

composer require mziraki/nova-persian-date-field

Usage

Add the field to your resource in the fields method:

use MZiraki\PersianDateField\PersianDate;
use MZiraki\PersianDateField\PersianDateTime;

PersianDate::make('DueOn')
    ->color('rgb(30, 136, 229)') // customize color
    ->format('jYYYY/jMM/jDD') // customize display format
    ->locale('fa,en'), // customize locale

PersianDateTime::make('PublishedAt')
    ->color('rgb(30, 136, 229)') // customize color
    ->format('jYYYY/jMM/jDD HH:mm:ss') // customize display format
    ->locale('fa,en'), // customize locale

The field extends the Laravel\Nova\Fields\Field field, so all the usual methods are available.

It is recommended that you include the standard date_format validation rule, as it is not automatically added.

Credits