I have an array of JS objects like this from an API call:
[
{
"date": "2018-09-21T07:00:00",
"assignments": 1
},
{
"date": "2018-09-17T07:00:00",
"assignments": 3
},
{
"date": "2018-09-12T07:00:00",
"assignments": 0
}
]
How can use Lodash to map this array to the following collection of objects?
{{
'2018-09-21': {selected: true},
'2018-09-17': {selected: true},
'2018-09-12': {selected: true}
}}
The {marked:true}
object can be hard-coded and the date needs to be formatted as shown.
Thanks!