Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time zone field to event details popup #143

Merged
merged 3 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ button.fc-button.finos-calendar-event-details-close img{
gap: 5px;
}

.event-timeZone{
font-size: 14px;
margin-bottom: 6px;
display: flex;
gap: 5px;
}

.event-location{
display:flex;
gap: 5px;
Expand Down Expand Up @@ -155,4 +162,4 @@ button.fc-button.finos-calendar-event-details-close img{
.finos-calendar-event-details a{
color: #343;
}
}
}
9 changes: 8 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import FullCalendar from '@fullcalendar/react';
import rrulePlugin from '@fullcalendar/rrule';
import timeGridPlugin from '@fullcalendar/timegrid';

import { mdiCalendarRange, mdiClose, mdiMapMarkerOutline } from '@mdi/js';
import { mdiCalendarRange, mdiClock, mdiClose, mdiMapMarkerOutline } from '@mdi/js';
import Icon from '@mdi/react';
import parse from 'html-react-parser';
import { createRef, useCallback, useEffect, useMemo, useState } from 'react';
Expand Down Expand Up @@ -136,6 +136,7 @@ function App() {
const toDate = printDate(eventDetails.end);
const fromTime = printTime(eventDetails.start);
const toTime = printTime(eventDetails.end);
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
let eventTime = '';
if (fromDate == toDate) {
eventTime = fromDate + ' ' + fromTime + ' - ' + toTime;
Expand Down Expand Up @@ -213,6 +214,12 @@ function App() {
</div>
<div>{eventTime}</div>
</div>
<div className="event-timeZone">
<div className="icon">
<Icon path={mdiClock} size={0.75} />
</div>
<div>Time Zone: {timeZone}</div>
</div>
{eventLocation && (
<div className="event-location">
<div className="icon">
Expand Down