I have a array about Events. How can I found the most near date in array about Events, and return the "Next" event ?
I need a function that use a default parameter "today now" or specific date, and return the Next event. I will render the result in a template on Vue3 composition api.
const data = [
{id: 1, date:'April 5 2022, 9:00hs', eventName:'dancing ballet', city:'Sao Paulo'},
{id: 2, date:'April 15 2022, 19:00hs', eventName:'party friends', city:'Buenos Aires'},
{id: 4, date:'April 25 2022, 8:00hs', eventName:'school test', city:'Sao Paulo'},
{id: 5, date:'April 30 2022, 21:00hs', eventName:'dinner', city:'Sao Paulo'}
];
const nextEvent = ??