Skip to content

Commit

Permalink
fix: properly render days in their locale
Browse files Browse the repository at this point in the history
  • Loading branch information
logaretm committed Feb 16, 2025
1 parent 3d80828 commit 225038d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/useCalendar/useCalendarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function useCalendarDaysView(
daysOfWeekFormat?: MaybeRefOrGetter<Intl.DateTimeFormatOptions['weekday']>,
) {
const dayFormatter = useDateFormatter(locale, () => ({ weekday: toValue(daysOfWeekFormat) ?? 'short' }));
const dayNumberFormatter = useDateFormatter(locale, () => ({ day: 'numeric' }));

const days = computed<CalendarDayCell[]>(() => {
const current = getSelectedDate();
Expand Down Expand Up @@ -133,7 +134,7 @@ function useCalendarDaysView(

return {
value: dayOfMonth,
label: String(dayOfMonth.day),
label: dayNumberFormatter.value.format(dayOfMonth.toDate()),
dayOfMonth: dayOfMonth.day,
isToday: rightNowDate.compare(domDate) === 0,
selected: currentDate.compare(domDate) === 0,
Expand Down

0 comments on commit 225038d

Please sign in to comment.