import React from "react"; import { getEventTime, getEventStart } from "../../../helpers/displayEvent"; import AddCal from "../AddCal/AddCal"; import { EventEvent, FilterBy, HideType } from "../../../../types/types"; import EventTitle from "../../atoms/EventTitle"; import EventLocation from "../../atoms/EventLocation"; import EventIcon from "@mui/icons-material/Event"; import InlineImage from "../InlineImage/InlineImage"; import { Box } from "@mui/system"; import { Stack, Typography, useTheme } from "@mui/material"; import moment from "moment"; import { ViewProps } from "../../../../types/types"; interface StandardInnerProps { event: EventEvent; filterby: FilterBy; truncatedescription?: string; hideaddcal?: HideType; hidedescription?: HideType; hideimages?: HideType; listclass: string; } const StandardInner = (props: StandardInnerProps) => { const { event, truncatedescription, hidedescription, hideimages } = props; return (
{getEventTime(event)}
); }; const Standard = (props: ViewProps) => { const { events, filterby, hideaddcal, truncatedescription, hidedescription, hideimages, } = props; const theme = useTheme(); let lastMonth = ""; let lastDay = ""; const getMonth = (event: EventEvent) => { const month = moment(getEventStart(event)).format("MMMM YYYY"); if (lastMonth !== month) { lastMonth = month; return ( {month} ); } return ""; }; const getEventStartDayString = (event: EventEvent) => { const displayDate = moment(getEventStart(event)).format("M/DD/YYYY"); if (lastDay !== displayDate) { lastDay = displayDate; return ( {displayDate} ); } return ""; }; return (
{events.length > 0 ? ( events.map((event) => { return (
{getMonth(event.event)} {getEventStartDayString(event.event)}
); }) ) : (

There are no upcoming events.

)}
); }; export default Standard;