Form Date
>= v1.20Form date component.
Date, Personalization Blocks
This content is part of TallStackUI personalization.
Example:
TallStackUi::personalize() ->form('date') ->block('block', 'classes');
The soft personalization should be done in boot
method of service providers.
Support for all Day.js formats
- You can use all Day.js formats.
- The formats are applicable only visually. The default backend format will always be YYYY-MM-DD
- The default date format sent to the component should be YYYY-MM-DD
Regardless of the format of the date, to send the date to the component you
must follow the pattern YYYY-MM-DD
. If the date are using a format different
than YYYY-MM-DD
, the correct thing to do is to use Carbon's createFromFormat
.
Let's take a look at an example considering the Brazilian date format:
// Your current date$date = '20/02/2024'; // 20/02/2024 // Formatting$date = now()->createFromFormat('d/m/Y', $date)->format('Y-m-d'); // Same date, but now in the correct format$date; // 2024-02-20
If you are using the component inside Livewire components, you
can use the mount
method to convert the date.
If you are using the component out of Livewire, you can to the
same logic in the controller methods before send the variable
to the Blade file.
Range mode allow the user to select only the start date. In this case the end date will be null.
An option to select only month and year.
An option to not show validation error message.