Skip to content

Commit

Permalink
fix: fix month highlighting in the day slider [PT-188059193]
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanik committed Aug 22, 2024
1 parent 3c0078e commit 87d7c4d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/grasp-seasons/components/slider/infinite-day-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@ export default class InfiniteDaySlider extends Slider {
this.generateMonthTicks(nextProps.lang);
}
const options = this.getSliderOpts(nextProps);
const originalSlide = options.slide;

options.slide = (event: any, ui: any) => {
originalSlide(event, ui);
const value = ui.value;
const month = Math.floor(value / MONTH_LEN);
const value = options.value;
if (value !== undefined) {
const date = new Date(2024, 0);
date.setDate(value + 1);
const month = date.getMonth();
this.$slider.find(".ui-slider-tick-label").each(function(this: any, idx: number) {
const $label = $(this);
if (idx === month) {
Expand All @@ -47,7 +46,7 @@ export default class InfiniteDaySlider extends Slider {
$label.removeClass("active");
}
});
};
}
this.$slider[this.sliderFuncName](options);
}

Expand Down

0 comments on commit 87d7c4d

Please sign in to comment.