We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
format-locale
1 parent 57b20e6 commit b8b24caCopy full SHA for b8b24ca
src/VueDatePicker/utils/util.ts
@@ -13,6 +13,7 @@ import type {
13
import { type Locale } from 'date-fns';
14
import type { ComponentPublicInstance } from 'vue';
15
import { getDate } from '@/utils/date-utils';
16
+import { localToTz } from '@/utils/timezone';
17
18
export const getArrayInArray = <T>(list: T[], increment = 3): T[][] => {
19
const items = [];
@@ -93,7 +94,7 @@ export const getMonths = (
93
94
try {
95
const monthDateFnsFormat = monthFormat === 'long' ? 'MMMM' : 'MMM';
96
return months.map((date, i) => {
- const month = format(date, monthDateFnsFormat, { locale: formatLocale });
97
+ const month = format(localToTz(date, 'UTC'), monthDateFnsFormat, { locale: formatLocale });
98
return {
99
text: month.charAt(0).toUpperCase() + month.substring(1),
100
value: i,
0 commit comments