From 30ff3e840d011ee2037a90656aaae1a9d6240ad2 Mon Sep 17 00:00:00 2001 From: Maxim Date: Wed, 27 Jul 2022 11:30:46 +0300 Subject: [PATCH] show real time on slt tooltips --- .../components/ScheduleSlot/ScheduleSlot.tsx | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/grafana-plugin/src/components/ScheduleSlot/ScheduleSlot.tsx b/grafana-plugin/src/components/ScheduleSlot/ScheduleSlot.tsx index 10ecb1bb..66d8920c 100644 --- a/grafana-plugin/src/components/ScheduleSlot/ScheduleSlot.tsx +++ b/grafana-plugin/src/components/ScheduleSlot/ScheduleSlot.tsx @@ -58,7 +58,7 @@ const ScheduleSlot: FC = observer((props) => { const title = getTitle(storeUser); return ( - }> + }>
= observer((props) => { ); }) ) : ( - }> + }>
{label &&
{label}
}
@@ -100,11 +100,12 @@ export default ScheduleSlot; interface ScheduleSlotDetailsProps { user: User; - currentUser: User; + currentTimezone: Timezone; + event: Event; } const ScheduleSlotDetails = (props: ScheduleSlotDetailsProps) => { - const { user, currentUser } = props; + const { user, currentTimezone, event } = props; const userStatus = 'success'; @@ -122,26 +123,26 @@ const ScheduleSlotDetails = (props: ScheduleSlotDetailsProps) => { - + {/* 30 apr, 7:54 - + */} - 30 apr, 00:00 - 30 apr, 23:59 + {dayjs(event.start).tz(user.timezone).format('DD MMM, HH:mm')} + {dayjs(event.end).tz(user.timezone).format('DD MMM, HH:mm')} - {currentUser?.username} + {currentTimezone} - 30 apr, 12:54 - 29 apr, 20:00 - 30 apr, 20:00 + {/* 30 apr, 12:54 */} + {dayjs(event.start).tz(currentTimezone).format('DD MMM, HH:mm')} + {dayjs(event.end).tz(currentTimezone).format('DD MMM, HH:mm')} @@ -149,15 +150,25 @@ const ScheduleSlotDetails = (props: ScheduleSlotDetailsProps) => { ); }; -interface ScheduleGapDetailsProps {} +interface ScheduleGapDetailsProps { + currentTimezone: Timezone; + event: Event; +} const ScheduleGapDetails = (props: ScheduleGapDetailsProps) => { - const {} = props; + const { currentTimezone, event } = props; return (
- Gaps this week + + + {currentTimezone} + {dayjs(event.start).tz(currentTimezone).format('DD MMM, HH:mm')} + {dayjs(event.end).tz(currentTimezone).format('DD MMM, HH:mm')} + + + {/*Gaps this week Number of gaps 12 @@ -165,7 +176,7 @@ const ScheduleGapDetails = (props: ScheduleGapDetailsProps) => { Time 23h 12m - + */}
);