'How to filter items from an array of day values where a day's integer value has to match any timestamp from a second array of event items?
In JSX I am mapping through a number of days that I have calculated in a month:
{range(daysInMonth).map((i) => (
<div
className="day-cell day-cell--in-month"
key={i}
>
{i + 1}
</div>
))}
I then have a array of events coming from an api:
const events = [
{
date: timestamp,
description: "Meeting with friends"
}
//More events//
]
How can I map through the array of events and match the event timestamp to the current timestamp of the date for the daysInMonth that is being mapped and then display the event description?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
