Skip to content

Commit

Permalink
fix error on changing year but calendar grid does not update
Browse files Browse the repository at this point in the history
  • Loading branch information
zenepay committed Oct 14, 2024
1 parent 02ef96a commit 279b923
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/js/buddhist-date-time-picker.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions resources/js/buddhist-date-time-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,21 @@ export default function buddhistDateTimePickerFormComponent({
if (!this.focusedYear || this.focusedYear?.length !== 4) {
return;
}
let year = +this.focusedYear;

if (this.isBuddhistYear(exceptLocales)) {
if (this.isBuddhistYear(onlyLocales)) {
// zenepay:if buddist convert to christ this gets from the form input
this.focusedYear = +this.focusedYear - 543;
year = +this.focusedYear - 543;
}

let year = +this.focusedYear;

if (!Number.isInteger(year)) {
year = dayjs().tz(timezone).year();
this.focusedYear = year;
}

if (this.focusedDate.year() === year) {
/* if (this.focusedDate.year() === year) {
return;
}
} */

this.focusedDate = this.focusedDate.year(year);
});
Expand Down

0 comments on commit 279b923

Please sign in to comment.