Skip to content

Commit

Permalink
Bugfix ("Sept" didn't parse)
Browse files Browse the repository at this point in the history
  • Loading branch information
daald committed Sep 22, 2020
1 parent 046632f commit b0bfe53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -2,10 +2,10 @@
"version": "0.0.1",
"main": "scraper.js",
"dependencies": {
"async": "^2.6.0",
"cheerio": "latest",
"request": "latest",
"sqlite3": "latest"
"async": "^2.6.3",
"cheerio": "^1.0.0-rc.3",
"request": "^2.88.2",
"sqlite3": "^5.0.0"
},
"keywords": [
"scraper",
Expand Down
6 changes: 3 additions & 3 deletions scraper.js
Expand Up @@ -177,17 +177,17 @@ function parseDate2(str) {
};
}

const monthNames = [undefined, 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sept', 'Okt', 'Nov', 'Dez']

function parseDate2_int(d, m, y) {
var nMonth = ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'].indexOf(m) + 1;
var nMonth = monthNames.indexOf(m);
assert(nMonth >= 1);
assert(y >= 2000);
assert(d >= 1);

return y + '-' + nMonth.toString().padStart(2, '0') + '-' + d.toString().padStart(2, '0');
}

const monthNames = [undefined, 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']

/* formats:
* "Schriftlich, Internet von Mi 22. Mai 2019 bis Sa 25. Mai 2019, Max. TN 15"
* "Internet von Mi 22. Mai 2019 bis Sa 25. Mai 2019"
Expand Down

0 comments on commit b0bfe53

Please sign in to comment.