diff --git a/.github/ISSUE_TEMPLATE/event.yml b/.github/ISSUE_TEMPLATE/event.yml index f157c14e..dfeaeedc 100644 --- a/.github/ISSUE_TEMPLATE/event.yml +++ b/.github/ISSUE_TEMPLATE/event.yml @@ -20,9 +20,9 @@ body: attributes: label: Mode options: - - On-site - - Online - - Hybrid + - OnlineEventAttendanceMode + - OfflineEventAttendanceMode + - MixedEventAttendanceMode - type: dropdown id: category attributes: diff --git a/src/components/events/EventInfoList.tsx b/src/components/events/EventInfoList.tsx index 955e3640..58720b4e 100644 --- a/src/components/events/EventInfoList.tsx +++ b/src/components/events/EventInfoList.tsx @@ -1,5 +1,5 @@ import { InlineIcon } from '@iconify/react'; -import { type ReducedEvent, formatterDate, formatterTime } from '~/util/EventUtil'; +import { type ReducedEvent, formatterDate, formatterTime, getHumanReadableAttendanceMode } from '~/util/EventUtil'; interface AdditionalListElements { __html: string; @@ -47,7 +47,7 @@ export default function EventInfoList({event, additional}: Props) {
  • - {event.data.category} | {event.data.mode} + {event.data.category} | {getHumanReadableAttendanceMode(event.data.mode)}
  • {/* audience */} diff --git a/src/content/events/2024-10-21_HandsOn-FAIR-RDM.md b/src/content/events/2024-10-21_HandsOn-FAIR-RDM.md index 2b0b793d..e4175a36 100644 --- a/src/content/events/2024-10-21_HandsOn-FAIR-RDM.md +++ b/src/content/events/2024-10-21_HandsOn-FAIR-RDM.md @@ -2,11 +2,11 @@ date: 2024-10-09 title: Hands-on Workshop on FAIR Data Management Using ARCs category: Training -excerpt: "The workshop covers the fundamentals of research data management and the principles of FAIR data." +description: "The workshop covers the fundamentals of research data management and the principles of FAIR data." when: start: 2024-10-21T09:30:00 end: 2024-10-23T15:00:00 -mode: Online +mode: OnlineEventAttendanceMode tutors: - Bianca Laker organizer: diff --git a/src/util/EventUtil.ts b/src/util/EventUtil.ts index b07ff20d..3d577d9d 100644 --- a/src/util/EventUtil.ts +++ b/src/util/EventUtil.ts @@ -2,6 +2,19 @@ import type { CollectionEntry } from 'astro:content'; type ExtractDateFn = (item: T) => Date; +export function getHumanReadableAttendanceMode(mode: 'OfflineEventAttendanceMode' | 'OnlineEventAttendanceMode' | 'MixedEventAttendanceMode'): string { + switch (mode) { + case 'OfflineEventAttendanceMode': + return 'In-person'; + case 'OnlineEventAttendanceMode': + return 'Online'; + case 'MixedEventAttendanceMode': + return 'Hybrid Event'; + default: + return 'Unknown Event Attendance Mode'; + } +} + export const formatterDate = new Intl.DateTimeFormat('de-DE', { timeZone: 'Europe/Berlin', day: "2-digit", month: "2-digit", year: "numeric"}); export function formatDateToHref(date: Date): string { return formatterDate