const timestampPBtoDate = ({ seconds }) => { return new Date(seconds * 1000); }; const formatDate = (date) => { return date.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric', }); }; // takes within.website.x.mi.Event export default ({ name, url, start_date, end_date, location, description }) => { const startDate = formatDate(timestampPBtoDate(start_date)); const endDate = formatDate(timestampPBtoDate(end_date)); return (
{location} - {startDate} {start_date.seconds !== end_date.seconds ? `thru ${endDate}` : ""}
{description}