techouse / intl-date-time

International DateTime for Laravel Nova
MIT License
57 stars 21 forks source link

Please make submit action obey date/time format to be a validd date #5

Closed wemersonrv closed 5 years ago

wemersonrv commented 5 years ago

Please make submit action obey date/time format to be a validd date

Example: User do not fill entire date format, just inform a part of date... but InlDateTime field accepts as dai **** from current month. If i'm forcing a format is because i want this pattern to be filled.

IntlDateTime::make('Birthdate', 'birthdate')
            ->rules('required', 'date')
            ->dateFormat('DD/MM/YYYY')
            ->hideFromIndex(),

intl

Other stuff: Make component accept only date, if i'm using a format DD/MM/YYYY or something like that don't need to complement it with 00:00:00

techouse commented 5 years ago

I am pretty sure this should not display any time if you don’t specify a timeFormat.

Please elaborate a bit more. How is your database schema set up? Are you using a date field or datetime field in MySQL?

The module itself is an extension of the Nova DateTime field, hence the name.

wemersonrv commented 5 years ago

Yep. Not show... but send it with 00:00:00 to save...

techouse commented 5 years ago

But if you would simply store the date in a MySQL date field instead of datetime it should not store any time, am I right?

user interface ui MySQL schema database_schema stored data stored_data

wemersonrv commented 5 years ago

I think so.

wemersonrv commented 5 years ago

But, about to abey the format? I think it's obvious that it's better to obey the format before consider a valid date... inform only a day or month is not enough to fill entire date

techouse commented 5 years ago

So if I understand you correctly you would like some sort of validation on the client side? In general the user would pick the date from the dropdown datepicker which is shown once the field is clicked.

If you want validation then please close this issue and make a new to make all conversation less confusing. 😇