Summer time error in bootstrap-datepicker

4

The plugin stopped working with the start of DST in Brazil. When I disable the option on my machine ( Automatically adjust for daylight saving time ) the plugin works again.

Code:

$('.campodata').datetimepicker({
    useSeconds: false,
    format: 'DD/MM/YYYY HH:MM'
});

Console error:

    
asked by anonymous 22.10.2014 / 20:25

1 answer

1

I recently had this problem. To fix it I edited an excerpt the fill method of the bootstrap-datepicker that used to be like this:

var prevMonth = new Date(year, month - 1, 28, 0, 0, 0, 0),
   day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());

And then it looks like this:

var prevMonth = new Date(year, month - 1, 28, 12, 0, 0, 0),
   day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());

And the parseDate method, where it was:

date.setHours(0);

Stayed:

date.setHours(12);
    
07.11.2014 / 13:23