mirror of
https://github.com/axzilla/templui.git
synced 2025-02-06 10:44:17 +00:00
fix(datepicker): shift blankdays by 1 to show correct days
This commit is contained in:
parent
1314acba11
commit
d32481c39b
@ -217,9 +217,11 @@ templ DatepickerScript() {
|
||||
},
|
||||
|
||||
calculateDays() {
|
||||
const firstDay = new Date(this.currentYear, this.currentMonth, 1).getDay();
|
||||
let firstDay = new Date(this.currentYear, this.currentMonth, 1).getDay();
|
||||
const daysInMonth = new Date(this.currentYear, this.currentMonth + 1, 0).getDate();
|
||||
|
||||
|
||||
firstDay = firstDay === 0 ? 6 : firstDay - 1;
|
||||
|
||||
this.blankDays = Array.from({ length: firstDay }, (_, i) => i);
|
||||
this.monthDays = Array.from({ length: daysInMonth }, (_, i) => i + 1);
|
||||
},
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user