Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calendarWeeks 'true' shows error on leftArrow #234

Open
pixelliquid opened this issue Jul 10, 2018 · 1 comment
Open

calendarWeeks 'true' shows error on leftArrow #234

pixelliquid opened this issue Jul 10, 2018 · 1 comment

Comments

@pixelliquid
Copy link

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.

@Steffan
Copy link

Steffan commented Aug 17, 2018

Hello PeterEmil,

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

Perhaps a pull request would be in place?

/Steffan

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

No branches or pull requests

2 participants