Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-messy-time

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-messy-time - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

11

index.js

@@ -101,2 +101,8 @@ var months = [

}
else if (/^\d{4}[\W_]\d{1,2}[\W_]\d{1,2}/.test(t)) {
var yms = t.split(/[\W_]/);
res.year = Number(yms[0]);
res.month = Number(yms[1]) - 1;
res.date = Number(yms[2]);
}
else if (m = /^(\d+)/.exec(t)) {

@@ -182,4 +188,2 @@ var x = Number(m[1]);

out.setSeconds(res.seconds === undefined ? 0 : res.seconds);
if (res.date !== undefined) out.setDate(res.date);
if (typeof res.month === 'number') {

@@ -189,3 +193,4 @@ out.setMonth(res.month);

else if (res.month) out.setMonth(months.indexOf(res.month));
if (res.date !== undefined) out.setDate(res.date);
if (res.year) out.setYear(res.year);

@@ -192,0 +197,0 @@ return out;

{
"name": "parse-messy-time",
"version": "1.2.1",
"version": "1.2.2",
"description": "parse messy human date and time strings",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -185,3 +185,18 @@ var parse = require('../');

);
t.equal(
strftime('%F %T', parse('2015-10-31', optsd)),
'2015-10-31 00:00:00',
'YYYY-MM-DD'
);
t.equal(
strftime('%F %T', parse('2015-10-31 20:30', optsd)),
'2015-10-31 20:30:00',
'YYYY-MM-DD HH:MM'
);
t.equal(
strftime('%F %T', parse('2015-10-31 8:30pm', optsd)),
'2015-10-31 20:30:00',
'YYYY-MM-DD informal'
);
t.end();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc