flowbite-datepicker icon indicating copy to clipboard operation
flowbite-datepicker copied to clipboard

Incorrect classes for prev/next days

Open klunejko opened this issue 1 year ago • 0 comments

Days belonging to the previous or next month aren't being displayed correctly, as "text-gray-500" is added without removing "text-gray-900". So you end up with an overview where every single day is shown in the same color.

https://github.com/themesberg/flowbite-datepicker/blob/a343785aa01c7671f891cacc491040e238c4acc5/js/picker/views/DaysView.js#L159

For that view, this should do the trick:

if (current < this.first) {
    classList.add("prev", "text-gray-500", "dark:text-white");
    classList.remove("text-gray-900");
} else if (current > this.last) {
    classList.add("next", "text-gray-500", "dark:text-white");
    classList.remove("text-gray-900");
}

klunejko avatar Dec 02 '24 19:12 klunejko