restore date range test, remove problematic test cases

This commit is contained in:
DIYgod
2019-01-09 19:04:37 +08:00
parent 6643233063
commit 38a089a436
3 changed files with 6 additions and 7 deletions

View File

@@ -26,6 +26,9 @@ module.exports = (html, timeZone) => {
} else if (/(\d+)年(\d+)月(\d+)日(\d+)时/.exec(html)) {
math = /(\d+)年(\d+)月(\d+)日(\d+)时/.exec(html);
date = new Date(parseInt(math[1]), parseInt(math[2]) - 1, parseInt(math[3]), parseInt(math[4]));
} else if (/(\d+)-(\d+)-(\d+) (\d+):(\d+)/.exec(html)) {
math = /(\d+)-(\d+)-(\d+) (\d+):(\d+)/.exec(html);
date = new Date(math[1], parseInt(math[2]) - 1, math[3], math[4], math[5]);
} else if (/(\d+)-(\d+) (\d+):(\d+)/.exec(html)) {
math = /(\d+)-(\d+) (\d+):(\d+)/.exec(html);
date = new Date(date.getFullYear(), parseInt(math[1]) - 1, math[2], math[3], math[4]);