themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.29k stars 708 forks source link

Datepicker - Today Button Doesn't Set Date in Input Box #915

Open tanami20 opened 2 days ago

tanami20 commented 2 days ago

Hi there,

Thanks so much for the latest version of the datepicker.

I only have one bug, which is that the "Today" button when clicked, brings the correct month into view, but does not select the date. The value in the input box is cleared and set to blank.

I am using Laravel, Jetstream and Tailwindcss.

If I have May 15 selected in calendar, and I click the "Today" button, the calendar will switch to June but it will not auto select today which is June 30.

Here is the code I have:

<input id="selectedCommandDate" datepicker datepicker-autohide datepicker-buttons datepicker-format="dd/mm/yyyy" datepicker-max-date="10/07/2024" datepicker- wire:model.live="selectedCommandDate" type="text" class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ps-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="Select date">

tanami20 commented 2 days ago

I have tried adding "datepicker-autoselect-today" however the button for Today then becomes not clickable and doesn't do anything. Maybe the issue is because of the datepicker-format?

zoltanszogyenyi commented 1 day ago

Hey @tanami20,

Do you have:

Cheers, Zoltan