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

calendarWeeks 'true' shows error on leftArrow

Open pixelliquid opened this issue 6 years ago • 1 comments

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">&nbsp;</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);
    },

calendarweeks-true

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.

pixelliquid avatar Jul 10 '18 13:07 pixelliquid

Hello PeterEmil,

I am experiencing the same issue. What changes did you do?

Perhaps a pull request would be in place?

/Steffan

Steffan avatar Aug 17 '18 09:08 Steffan