Here's a sample of what I have:
[{
"probeTemp": "35.40",
"dateProbe": "2015-08-1"
}, {
"probeTemp": "34.89",
"dateProbe": "2015-08-3"
}, {
"probeTemp": "34.42",
"dateProbe": "2015-08-5"
}]
How can I fill the missing dates between the min and max dates in the json string so the missing fields end up like this?
[{
"probeTemp": "35.40",
"dateProbe": "2015-08-1"
}, {
"probeTemp": null,
"dateProbe": "2015-08-2"
}, {
"probeTemp": "34.89",
"dateProbe": "2015-08-3"
}, {
"probeTemp": null,
"dateProbe": "2015-08-4"
}, {
"probeTemp": "34.42",
"dateProbe": "2015-08-5"
}]
I found this thread, but I don't know how I could apply it to my data. Any help?
Edit 2: This is what I tried so far, but I'm getting Uncaught TypeError: Cannot read property 'length' of undefined at lines 7 and 23.
2015-08-3duplicated ?