Skip to content

Commit 3a3e712

Browse files
committed
🐛(Date): Fixed locale in PickerDate class
1 parent a19431c commit 3a3e712

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

.size-snapshot.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
22
"dist/vue-datepicker.min.js": {
3-
"bundled": 140743,
4-
"minified": 80246,
5-
"gzipped": 20705
3+
"bundled": 140715,
4+
"minified": 80242,
5+
"gzipped": 20709
66
},
77
"dist/vue-datepicker.esm.js": {
8-
"bundled": 140729,
9-
"minified": 86524,
10-
"gzipped": 21832,
8+
"bundled": 140701,
9+
"minified": 86496,
10+
"gzipped": 21835,
1111
"treeshaked": {
1212
"rollup": {
13-
"code": 80064,
13+
"code": 80060,
1414
"import_statements": 144
1515
},
1616
"webpack": {
17-
"code": 81193
17+
"code": 81197
1818
}
1919
}
2020
},
2121
"dist/vue-datepicker.umd.js": {
22-
"bundled": 149880,
23-
"minified": 80543,
24-
"gzipped": 20826
22+
"bundled": 149852,
23+
"minified": 80539,
24+
"gzipped": 20830
2525
}
2626
}

dist/vue-datepicker.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-datepicker.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-datepicker.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-datepicker.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/Dates.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dayjs.extend(weekOfYear);
3131
export default class PickerDate {
3232
constructor (month, year, { lang = en } = {}) {
3333
dayjs.locale(lang);
34-
this.start = generateDate().year(year).month(month).startOf('month');
34+
this.start = dayjs().year(year).month(month).startOf('month');
3535
this.end = this.start.endOf('month');
3636
this.month = month;
3737
this.year = year;
@@ -43,12 +43,12 @@ export default class PickerDate {
4343
return Array.from(generateDateRange(this.start, this.end));
4444
}
4545
getMonths () {
46-
return Array.apply(0, Array(12)).map((_, i) => generateDate().month(i).format('MMM'));
46+
return Array.apply(0, Array(12)).map((_, i) => dayjs().month(i).format('MMM'));
4747
}
4848
getQuarters () {
4949
return Array.apply(0, Array(4)).map((_, i) => {
50-
const quarterMonthStart = generateDate().quarter(i + 1).startOf('quarter').format('MMMM');
51-
const quarterMonthEnd = generateDate().quarter(i + 1).endOf('quarter').format('MMMM');
50+
const quarterMonthStart = dayjs().quarter(i + 1).startOf('quarter').format('MMMM');
51+
const quarterMonthEnd = dayjs().quarter(i + 1).endOf('quarter').format('MMMM');
5252
return `${quarterMonthStart} - ${quarterMonthEnd}`;
5353
});
5454
}

0 commit comments

Comments
 (0)