UMD Web Utilities Library
    Preparing search index...

    Function createEventDetails

    • Creates a structured event details object from date and location information

      Combines start date, optional end date, and location information into a unified event details object. Useful for creating calendar events, event listings, etc.

      Parameters

      • locationElement: {
            endDate?: Record<string, string> | null;
            locationElement?: HTMLElement | Element | null;
            startDate: Record<string, string>;
        }

        Optional element containing location text

      Returns any

      Event details object with formatted date and location information

      const details = createEventDetails({
      locationElement: document.querySelector('.location'),
      startDate: {
      dayOfWeek: 'Mon',
      month: 'Sep',
      day: '29',
      time: '2:30pm'
      },
      endDate: {
      dayOfWeek: 'Mon',
      month: 'Sep',
      day: '29',
      time: '4:30pm'
      }
      });
      // Returns object with startDayOfWeek, startMonth, startDay, startTime,
      // endDayOfWeek, endMonth, endDay, endTime, and location properties