fixup! fix: implement useTranslations for start date on event detail popover
This commit is contained in:
committed by
Linus Rath
parent
31024396e3
commit
c406fbb73e
@@ -19,6 +19,7 @@ import {
|
|||||||
getUserStatus,
|
getUserStatus,
|
||||||
getParticipantList,
|
getParticipantList,
|
||||||
} from "@/lib/calendar-participants";
|
} from "@/lib/calendar-participants";
|
||||||
|
import { useFormatEventDate } from "@/hooks/use-format-event-date";
|
||||||
|
|
||||||
interface EventDetailPopoverProps {
|
interface EventDetailPopoverProps {
|
||||||
event: CalendarEvent;
|
event: CalendarEvent;
|
||||||
@@ -253,13 +254,7 @@ export function EventDetailPopover({
|
|||||||
|
|
||||||
const hasParticipants = participants.length > 0;
|
const hasParticipants = participants.length > 0;
|
||||||
|
|
||||||
const formatEventDate = useCallback((startDate: Date): string => {
|
const formatEventDate = useFormatEventDate();
|
||||||
const dayOfWeek = format(startDate, "EEE").toLowerCase();
|
|
||||||
const month = format(startDate, "MMM").toLowerCase();
|
|
||||||
const day = format(startDate, "d");
|
|
||||||
const year = format(startDate, "yyyy");
|
|
||||||
return `${t(`days.${dayOfWeek}`)}, ${t(`months.${month}`)} ${day}, ${year}`;
|
|
||||||
}, [t]);
|
|
||||||
|
|
||||||
const popover = (
|
const popover = (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user