jquery.mtz.monthpicker icon indicating copy to clipboard operation
jquery.mtz.monthpicker copied to clipboard

Bug: looks for SelectedMonth like "Dec" in data-month that stored "12"

Open rickardliljeberg opened this issue 10 years ago • 0 comments

I have set up the pattern: 'mmm yyyy', I then also sen in my own month names for i18n.

I give it a selectedMonth: 12 in the options.

But when I trace the code it is 12 until this line of code runs in init: $this.monthpicker('parseInputValue', settings);

After that line of code selectedMonth is 'Dec' instead of 12

And thats a problem, because for instance when changing year in the dropdown this will run

if ($(this).val() == settings.selectedYear) 
{
  months.filter('td[data-month=' + settings.selectedMonth + ']').addClass('ui-state-active');
}

And since the html looks like so

<td class="ui-state-default mtz-monthpicker mtz-monthpicker-month" style="padding:5px;cursor:default;" data-month="12">Dec</td>

it will not find the data-month since it's now looking for 'Dec' not 12.

rickardliljeberg avatar Dec 06 '14 21:12 rickardliljeberg