Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

setMinDate greyed out time gets black again after click #127

Open
lsascha opened this issue Nov 7, 2016 · 2 comments
Open

setMinDate greyed out time gets black again after click #127

lsascha opened this issue Nov 7, 2016 · 2 comments

Comments

@lsascha
Copy link

lsascha commented Nov 7, 2016

I noticed something that might be confusing for people who use the datetimepicker.

When i use setMinDate and use the time-picker, the hours before the defined minDate are greyed out like expected, however as soon as i click some time there, the hours greyed out before, get black again, but they are still not selectable.

@lsascha
Copy link
Author

lsascha commented Nov 7, 2016

ok. i have found a pull request for this already.
#109

i checked the code (unfortunately he converted spaces to tabs or something like that, so the changes are not much helpful)

but i found that only
this.initHours(); was added to the end of _onSelectHour function and
this.initMinutes(); was added to the end of _onSelectMinute function.

i tested it, and it helped. :) So +1 for mergin it.

@bbouabou
Copy link

bbouabou commented Mar 12, 2017

To solve this bug, I changed the for loop in onSelectHour :

for (var i = 0; i < th.length; i++)
{
   if (!this.toggleTime(i, true))
       $(th[i]).attr('fill', '#bdbdbd');
   else
       $(th[i]).attr('fill', '#000');
}

And in onSelectMinute :

for (var i = 0; i < tm.length; i++)
{
    if (!this.toggleTime(i * 5, false))
        $(tm[i]).attr('fill', '#bdbdbd');
    else
        $(tm[i]).attr('fill', '#000');
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants