diff --git a/components/Calendar.js b/components/Calendar.js index 8431a5416f1a..0a1388d2ccc2 100644 --- a/components/Calendar.js +++ b/components/Calendar.js @@ -1,25 +1,12 @@ -import moment from 'moment'; import eventsData from '../config/meetings.json'; import GoogleCalendarButton from './buttons/GoogleCalendarButton'; import Heading from './typography/Heading'; +import { getEvents } from '../lib/staticHelpers'; export default function Calendar({ className = '', size, text="text-left" }) { const CALENDAR_URL = 'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC'; const eventsExist = eventsData.length > 0; - - function getEvents() { - let meetingsWithDates = eventsData.map((event) => ({ - ...event, - date: moment(event.date), - })); - meetingsWithDates.sort((a, b) => a.date - b.date); - return meetingsWithDates - .filter((meeting) => meeting.date > new Date()) - .slice(0, size || meetingsWithDates.length); - } - - return (
slack-cover @@ -177,8 +178,9 @@ function CommunityIndexPage() { className="text-sm mt-10" > Join an AsyncAPI meeting from anywhere in the world! We host both - live and recorded community events. You can also sign up for - our community newsletter to stay up-to-date on all meetings and events. + live and recorded community events. You can also sign up for our + community newsletter to stay up-to-date on all meetings and + events.