64robots / nova-fields

A collection of customizable Nova Fields.
https://nova-fields.netlify.com
MIT License
286 stars 78 forks source link

updated Date Form Input to support nova-v3 format picker #213

Open prima-ca opened 2 years ago

prima-ca commented 2 years ago

This brings the Date form-field components up to the current Nova v3.29 capabilities, most importantly allowing the specification of alternate date formats, as described in https://nova.laravel.com/docs/3.0/resources/fields.html#date-formats

e.g.

Date::make( 'When', 'when_column') ->default(now())
                    ->labelClasses('w-full pt-4')
                    ->wrapperClasses('flex flex-col w-1/3 flex-1 px-4 pr-8')
                    ->fieldClasses('w-full py-4')
                    ->pickerDisplayFormat('d/m/Y')
                    ->format('DD/MM/YYYY');

The same could/should be done for DateTime, but as I haven't personally needed it... shrug

The package.json and yarn.lock file are also slightly modified to allow usage of node-sass@^6.0.1 as the old node-sass just doesn't compile.

dvigueras commented 2 years ago

Hi @prima-ca thanks for your contribution.

Our team has been reviewing you PR and a little detail has caught our attention. What's the benefit of adding the new class to the $wrapperClasses attribute in src/Configurable.php ?