Skip to content

Commit

Permalink
Merge pull request #429 from abhigyanghosh30/fix-issue-412
Browse files Browse the repository at this point in the history
fix(datepicker): Date picker didnot change calendar when selecting month or year from dropdown
  • Loading branch information
wuda-io authored Oct 19, 2023
2 parents b90cb22 + d9b7a82 commit aee5d8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export interface DatepickerOptions extends BaseOptions {
* @default null
*/
onDraw: (() => void) | null;

/** Field used for internal calculations DO NOT CHANGE IT */
minYear?: any;
/** Field used for internal calculations DO NOT CHANGE IT */
Expand Down Expand Up @@ -261,7 +261,7 @@ export class Datepicker extends Component<DatepickerOptions> {
constructor(el: HTMLInputElement, options: Partial<DatepickerOptions>) {
super(el, options, Datepicker);
(this.el as any).M_Datepicker = this;

this.options = {
...Datepicker.defaults,
...options
Expand Down Expand Up @@ -847,8 +847,8 @@ export class Datepicker extends Component<DatepickerOptions> {
});

// Add change handlers for select
yearSelect.addEventListener('change', () => this._handleYearChange);
monthSelect.addEventListener('change', () => this._handleMonthChange);
yearSelect.addEventListener('change', this._handleYearChange);
monthSelect.addEventListener('change', this._handleMonthChange);

if (typeof this.options.onDraw === 'function') {
this.options.onDraw.call(this);
Expand Down

0 comments on commit aee5d8e

Please sign in to comment.