Skip to content

Commit b466d01

Browse files
hitmandshitmands
authored andcommitted
2 parents 7aea097 + 34da34b commit b466d01

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

TextToJsonAdapter.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ function textToJsonAdapter(text) {
3838
let value = item.pop();
3939

4040
if(isRawDate(value)) {
41-
value = new Date(
42-
Date.UTC(...value
41+
let date = value
4342
.split('-')
4443
.map((item, index) => {
4544
item = Number(item);
@@ -52,7 +51,10 @@ function textToJsonAdapter(text) {
5251
}
5352

5453
return item;
55-
}))
54+
});
55+
56+
value = new Date(
57+
Date.UTC(date[0], date[1], date[2])
5658
);
5759
}
5860

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class IANAParser {
1313
return REGISTRY_URL;
1414
}
1515

16-
parser() {
16+
parse() {
1717
return parser.apply(this, arguments);
1818
}
1919

@@ -26,7 +26,7 @@ class IANAParser {
2626
res
2727
.setEncoding("utf8")
2828
.on('data', (chunk) => (body += chunk))
29-
.on('end', () => resolve(this.parser(body)))
29+
.on('end', () => resolve(this.parse(body)))
3030
;
3131

3232
})

0 commit comments

Comments
 (0)