Skip to content

Commit

Permalink
[pickers] Fix AdapterMomentJalaali regression
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed May 15, 2024
1 parent 6157651 commit cb24a44
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,11 @@ export class AdapterMomentJalaali
};

public isSameYear = (value: Moment, comparing: Moment) => {
// `isSame` seems to mutate the date on `moment-jalaali`
// @ts-ignore
return value.clone().isSame(comparing, 'jYear');
return value.jYear() === comparing.jYear();
};

public isSameMonth = (value: Moment, comparing: Moment) => {
// `isSame` seems to mutate the date on `moment-jalaali`
// @ts-ignore
return value.clone().isSame(comparing, 'jMonth');
return value.jYear() === comparing.jYear() && value.jMonth() === comparing.jMonth();
};

public isAfterYear = (value: Moment, comparing: Moment) => {
Expand Down

0 comments on commit cb24a44

Please sign in to comment.