foundation-datepicker
foundation-datepicker copied to clipboard
calendarWeeks 'true' shows error on leftArrow
When calendarWeeks is set to true the rendering of the first table row has an error: instead of showing the set variable for leftArrow
it is showing the string of date-switch
As far as I can see this is a result of the prepending on lines 466 - 479:
fillDow: function () {
var dowCnt = this.weekStart,
html = '<tr>';
if (this.calendarWeeks) {
var cell = '<th class="cw"> </th>';
html += cell;
this.picker.find('.datepicker-days thead tr:first-child').prepend(cell);
}
while (dowCnt < this.weekStart + 7) {
html += '<th class="dow">' + dates[this.language].daysMin[(dowCnt++) % 7] + '</th>';
}
html += '</tr>';
this.picker.find('.datepicker-days thead').append(html);
},
To my best knowledge it seems that the code to inject the string into date-switch
is using a positional argument instead of targeting date-switch
according to lines 514 - 519:
this.picker.find('.datepicker-days thead th:eq(1)')
.text(dates[this.language].months[month] + ' ' + year);
this.picker.find('.datepicker-hours thead th:eq(1)')
.text(dayMonth + ' ' + dates[this.language].months[month] + ' ' + year);
this.picker.find('.datepicker-minutes thead th:eq(1)')
.text(dayMonth + ' ' + dates[this.language].months[month] + ' ' + year);
To correct this error I changed the code to target date-switch
, together with a modification on the conditional calendarWeeks
to correct the colspan on date-switch
.
If anyone is interested I can create a Pull Request.
Hello PeterEmil,
I am experiencing the same issue. What changes did you do?
Perhaps a pull request would be in place?
/Steffan