diff --git a/components/Calendar.tsx b/components/Calendar.tsx index 767f29648809..5a5bfd2ba134 100644 --- a/components/Calendar.tsx +++ b/components/Calendar.tsx @@ -28,10 +28,16 @@ export default function Calendar({ className = '', size }: ICalendarProps) { const CALENDAR_URL = 'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC'; - const eventsExist = eventsData.length > 0; + const currentDate = new Date(); + const eventsExist = eventsData?.filter((event: IEvent) => moment(event.date).isAfter(currentDate)).length > 0; return ( -
+
{t('calendar.title')} @@ -43,7 +49,7 @@ export default function Calendar({ className = '', size }: ICalendarProps) { {moment(event.date).format('D')}
-

{event.title}

+

{event.title}

{moment(event.date).local().format('LLLL')} UTC {moment(event.date).local().format('Z')} @@ -53,13 +59,12 @@ export default function Calendar({ className = '', size }: ICalendarProps) { ))} - {eventsExist ? ( -

+
+ {!eventsExist &&
{t('calendar.noMeetingsMessage')}
} +
- ) : ( -
{t('calendar.noMeetingsMessage')}
- )} +
); } diff --git a/pages/[lang]/index.tsx b/pages/[lang]/index.tsx index ad5fe83ba6c9..634982c9ee2a 100644 --- a/pages/[lang]/index.tsx +++ b/pages/[lang]/index.tsx @@ -108,7 +108,7 @@ export default function HomePage() {
- +
diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 04d3c5c53986..d4b611fef9cf 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -23,6 +23,6 @@ "calendar": { "title": "Kommende Veranstaltungen", "viewCalendarBtn": "Kalender ansehen", - "noMettingsMessage": "In den nächsten Tagen sind keine Sitzungen geplant." + "noMeetingsMessage": "In den nächsten Tagen sind keine Sitzungen geplant. Sie können bevorstehende Veranstaltungen überprüfen, indem Sie auf die Schaltfläche unten klicken." } } \ No newline at end of file diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 28fc28df539d..8ac45ed2d0e1 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -23,6 +23,6 @@ "calendar": { "title": "Upcoming events", "viewCalendarBtn": "View Calendar", - "noMettingsMessage": "There are no meetings scheduled for next few days." + "noMeetingsMessage": "There are no meetings scheduled for next few days. You can check upcoming events by clicking the button below." } -} \ No newline at end of file +} diff --git a/tests/build-tools.test.js b/tests/build-tools.test.js index 6cb391d93deb..5e49682cce28 100644 --- a/tests/build-tools.test.js +++ b/tests/build-tools.test.js @@ -26,7 +26,7 @@ jest.mock('../scripts/tools/tags-color', () => ({ })); describe('buildTools', () => { - const testDir = path.join(os.tmpdir(), 'test_config'); + const testDir = path.join(String(os.tmpdir()), 'test_config'); const toolsPath = resolve(testDir, 'tools.json'); const tagsPath = resolve(testDir, 'all-tags.json'); const automatedToolsPath = resolve(testDir, 'tools-automated.json');