parse-messy-time
Advanced tools
Comparing version 2.0.2 to 2.1.0
11
index.js
@@ -89,2 +89,12 @@ var months = [ | ||
} | ||
else if (/noon/.test(t)) { | ||
res.hours = 12 | ||
res.minutes = 0 | ||
res.seconds = 0 | ||
} | ||
else if (/midnight/.test(t)) { | ||
res.hours = 0 | ||
res.minutes = 0 | ||
res.seconds = 0 | ||
} | ||
else if (/\d+[:h]\d+/.test(t) || /^(am|pm)/.test(next)) { | ||
@@ -199,3 +209,2 @@ var hms = parseh(t, next); | ||
} | ||
var out = new Date(now); | ||
@@ -202,0 +211,0 @@ out.setHours(res.hours === undefined ? 0 : res.hours); |
{ | ||
"name": "parse-messy-time", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "parse messy human date and time strings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -253,3 +253,13 @@ var parse = require('../'); | ||
); | ||
t.equal( | ||
strftime('%F %T', parse('tomorrow at noon', optsd)), | ||
'2015-04-15 12:00:00', | ||
'tomorrow at noon' | ||
); | ||
t.equal( | ||
strftime('%F %T', parse('in 6 days at midnight', optsd)), | ||
'2015-04-20 00:00:00', | ||
'in 6 days at midnight' | ||
); | ||
t.end(); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22973
608