What I want to achieve is, to filter the JSON by past and future events from the current date - like now. My "past" API route should display only the past events, like "id":1 for this example.
Can I do that with, let's say, momentjs and lodash? What would be a correct approach?
This is my JSON array containing the datetime timestamp.
[
{
"id": 1,
"datetime": "2017-08-18T15:15:00+0200",
},
{
"id": 2,
"datetime": "2020-03-31T10:30:00+0200",
},
{
"id": 3,
"datetime": "2020-03-31T10:30:00+0200",
}
]