Skip to content

Commit cbb1150

Browse files
committed
dataparser: finally fix ancient date parsing bug
don't create adate object; instead just feed the unix integer date to `moment`
1 parent a243fce commit cbb1150

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DataParsers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async function getWOJSON (stationData, last, needCors = true) {
104104
// console.log(res.headers.get('Content-Type'))
105105
return res.json()
106106
})
107-
.then ( (json) => { console.log(json);return json["47"].provisional} )
107+
.then ( (json) => { console.log('WOJSON', json);return json["47"].provisional} )
108108
.catch(function(error){console.log(error);});
109109
}
110110

@@ -114,11 +114,12 @@ async function processWOData (spot, latest) {
114114
.then ( function (rawData) {
115115
return rawData.map((item) => {
116116
let meta = {};
117+
117118
meta.height = Number(item[1]);
118119
meta.quality = testGood(item[1], spot);
119120
meta.units = spot.units;
120121
meta.data = item;
121-
const itemObj = { x: new Date(item[0]),
122+
const itemObj = { x: item[0],
122123
y: item[1],
123124
meta: meta
124125
};

0 commit comments

Comments
 (0)