SniberbS
Reactiflux4y ago
8 replies
Sniberb

⛄ Snowberb ⛄ – 10-46 Jun 1

I'm trying to get the Max and the Min dates from an array of objects, but im having some problems. This is what I've done:

startDate: new Date(Math.max(...bonuses.map((bonus) => new Date(bonus.fecha_evento))))


The problem is that typescript is telling me
Argument of type 'Date' is not assignable to parameter of type 'number'

How can I get the min and the max dates from an array of objects?
Was this page helpful?