Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user