Files
workavia-calendar-front/src/features/Events/EventPreview/EventTimeSubtitle.tsx
T
Camille Moussu 35cd128106 [#17] added event counter popup (#665)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2026-03-25 11:14:16 +01:00

28 lines
813 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { getTimezoneOffset } from "@/utils/timezone";
import { Typography } from "@linagora/twake-mui";
import { CalendarEvent } from "../EventsTypes";
import { formatDate } from "./utils/formatDate";
import { formatEnd } from "./utils/formatEnd";
export function EventTimeSubtitle({
event,
t,
timezone,
}: {
event: CalendarEvent;
t: (k: string, p?: string | object | undefined) => string;
timezone: string;
}) {
const formattedEnd = event.end
? formatEnd(event.start, event.end, t, timezone, event.allday)
: null;
return (
<Typography color="text.secondaryContainer">
{formatDate(event.start, t, timezone, event.allday)}
{formattedEnd &&
` ${formattedEnd} ${!event.allday ? getTimezoneOffset(timezone, new Date(event.start)) : ""}`}
</Typography>
);
}