mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-04 00:48:52 +02:00
🐛 Fix final time for scheduled all day event
This commit is contained in:
parent
edefedd5c5
commit
29c8447f56
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,7 @@ import { Card, CardContent } from "@rallly/ui/card";
|
|||
import { DateIconInner } from "@/components/date-icon";
|
||||
import { ParticipantAvatarBar } from "@/components/participant-avatar-bar";
|
||||
import { useParticipants } from "@/components/participants-provider";
|
||||
import { Trans } from "@/components/trans";
|
||||
import { usePoll } from "@/contexts/poll";
|
||||
import { useDayjs } from "@/utils/dayjs";
|
||||
|
||||
|
@ -24,6 +25,9 @@ function DateIcon({ start }: { start: Date }) {
|
|||
function FinalTime({ start, duration }: { start: Date; duration: number }) {
|
||||
const poll = usePoll();
|
||||
const { adjustTimeZone, dayjs } = useDayjs();
|
||||
if (duration === 0) {
|
||||
return <Trans i18nKey="allDay" />;
|
||||
}
|
||||
return (
|
||||
<span>{`${adjustTimeZone(start, !poll.timeZone).format("LT")} - ${adjustTimeZone(dayjs(start).add(duration, "minutes"), !poll.timeZone).format("LT")}`}</span>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue