Closed cicimbrus closed 1 month ago
I solved the problem by adding an option. todayBtnMode
with mode 1
.
document.addEventListener('DOMContentLoaded', () => {
const dateRangePickerEl = document.getElementById('date-range-picker');
if (dateRangePickerEl) {
new DateRangePicker(dateRangePickerEl, {
autohide: true,
todayBtn: true,
todayBtnMode: 1,
clearBtn: true,
format: 'yyyy-mm-dd',
weekStart: 1,
todayHighlight: true,
});
}
});
Description: I am using the DateRangePicker from flowbite-datepicker in my Laravel project. Everything works fine, including the "Clear" button and date selection, but the "Today" button does not set the date to today's date when clicked.
Steps to Reproduce: Install
flowbite
andflowbite-datepicker
via npm. Import and initializeDateRangePicker
inapp.js
.import
flowbite
;import
DateRangePicker
fromflowbite-datepicker/DateRangePicker
;Add the following HTML to my Blade template:
Expected Behavior: When clicking the "Today" button, the date picker should set the date fields to today's date.
Actual Behavior: The "Today" button is visible, but clicking it does not set the date fields to today's date.
Additional Information:
flowbite
version: [2.3.0]flowbite-datepicker
version: [1.2.6]Thank you for your assistance!