Skip to content

Commit

Permalink
fix: customMonthValues incorrect behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
PawanKolhe committed Jul 13, 2021
1 parent 9de50e6 commit b3e6253
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "color-calendar",
"version": "1.0.5",
"version": "1.0.7",
"description": "A customizable events calendar widget library",
"main": "dist/bundle.cjs.js",
"module": "dist/bundle.esm.js",
Expand Down Expand Up @@ -88,4 +88,4 @@
"browserslist": [
"defaults"
]
}
}
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class Calendar {
this.disableMonthYearPickers = options.disableMonthYearPickers ?? false;
this.disableDayClick = options.disableDayClick ?? false;
this.disableMonthArrowClick = options.disableMonthArrowClick ?? false;
this.customMonthValues = (options.customMonthValues && options.customMonthValues.length === 12) ? options.customMonthValues : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
this.customMonthValues = options.customMonthValues;
this.customWeekdayValues = options.customWeekdayValues;
this.monthChanged = options.monthChanged;
this.dateChanged = options.dateChanged;
Expand Down Expand Up @@ -218,7 +218,7 @@ export default class Calendar {
<div class="calendar__days"></div>
<div class="calendar__picker">
<div class="calendar__picker-month">
${this.customMonthValues.map((month, i) => `<div class="calendar__picker-month-option" data-value="${i}">${month}</div>`).join('')}
${(this.customMonthValues ?? ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']).map((month, i) => `<div class="calendar__picker-month-option" data-value="${i}">${month}</div>`).join('')}
</div>
<div class="calendar__picker-year">
<div class="calendar__picker-year-option" data-value="0"></div>
Expand Down

0 comments on commit b3e6253

Please sign in to comment.