Skip to content

Commit

Permalink
fix(datepicker): language config is now initialized correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
axzilla committed Jan 10, 2025
1 parent d95bdc6 commit e373dbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions pkg/components/datepicker.templ
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ templ DatepickerScript() {
position: 'bottom',

init() {
const monthNames = JSON.parse(this.$el?.dataset?.monthnames);
if (monthNames) {
this.months = monthNames;
}

const dayNames = JSON.parse(this.$el?.dataset?.daynames);
if (dayNames) {
this.days = dayNames;
}

this.format = this.$el.dataset.format;
const initialDate = this.$el?.dataset?.value ? new Date(this.parseDate(this.$el?.dataset?.value)) : new Date();
this.currentMonth = initialDate.getMonth();
Expand Down
12 changes: 6 additions & 6 deletions pkg/components/datepicker_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e373dbf

Please sign in to comment.