Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datepicker returning uncaught typeError: undefined 'currentDay'

I've been using jQuery UI with Bootstrap and I seem to run into a problem that I haven't had before. I'm not sure what has changed; I've tried setting back different version of jQuery and I didn't update the jQuery UI in the meanwhile. So I'm not exactly sure what broke.

The error from the console when I click on any date in the datepicker returns:

Uncaught TypeError: Cannot set property 'currentDay' of undefined  

The code is fairly straightforward as one would expect from a datepicker:

$(".datepicker").datepicker({ dateFormat: 'dd-mm-yy' });  

With the following HTML:

<input type="text" class="datepicker" /> 

Is this a bug that should be reported (since no other Google matches turn up) or is it something else I've missed?

like image 528
Bjorn 'Bjeaurn' S Avatar asked Jul 22 '13 06:07

Bjorn 'Bjeaurn' S


1 Answers

I've found the solution. After a long time of debugging I figured out that there was a <div> that had the exact same ID, lying higher than the input field. Therefore the script took the first instance that contained the ID and picked the DIV instead of the input field.

I removed/renamed the DIV and it worked fine again.

like image 73
Bjorn 'Bjeaurn' S Avatar answered Oct 24 '22 10:10

Bjorn 'Bjeaurn' S