152
rated 0 times
[
156]
[
4]
/ answers: 1 / hits: 21419
/ 8 Years ago, thu, september 15, 2016, 12:00:00
Aside from the occasional jQuery selectors and element modifications, I'm not too great at javascript. For a problem I'm having, I need to filter out a javascript object by date. I have a structure that looks like this:
Object { version: 3.1.1, released_on: 2016-08-21T00:00:00.000Z, high_vulns: 15, medium_vulns: 10, low_vulns: 5 }
I want to find all of the objects from 10 years so between 2016-08-21T00:00:00.000Z
and 2010-08-21T00:00:00.000Z
The problem I'm experiencing is that the released_on:
field is a string not a date. Would I need to create a new Date()
object convert it into a string, and then use .filter
or would I do the opposite, convert the string into a date and then filter. Has anyone tried something like this before?
More From » jquery