Skip to content

Instantly share code, notes, and snippets.

@michel47

michel47/README.md

Created Apr 8, 2021
Embed
What would you like to do?
\\SO answer ...
let json=[
{
"track": "Virtual 1",
"data": {
"20210310": [
{
"start": "8:20 a.m.",
"end": "",
"company": "Otonomo",
"ticker": "OTON"
} ]
}
}];
((dataStr) => { dataStr.forEach( function(n, i) {
console.log(i+':',n);
console.log(Object.keys(n.data));
Object.keys(n.data).forEach(
k => {
let day = k.replace(/(....)(..)(..)/,`$1-$2-$3`);
let time = n.data[k][0].start.replace(' a.m.','')
let date = new Date(`${day} ${time}`);
console.dir(date.toGMTString())
console.dir(n.data[k])
// some code here using n.data[k];
// like createTableCells(tab1, n.data[k]);
console.info(`${k}: ${n.data[k][0].ticker}; start: ${date}...`);
});
} )
})(json);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment