Socket
Socket
Sign inDemoInstall

humanize

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5 to 0.0.6

2

humanize.js

@@ -305,3 +305,3 @@

if (timeDiff < 60 && timeDiff > -60) {
return (timeDiff >= 0 ? timeDiff + ' seconds ago' : 'in ' + (-timeDiff) + ' seconds');
return (timeDiff >= 0 ? Math.floor(timeDiff) + ' seconds ago' : 'in ' + Math.floor(-timeDiff) + ' seconds');
}

@@ -308,0 +308,0 @@

@@ -19,3 +19,3 @@ {

"main": "humanize.js",
"version": "0.0.5",
"version": "0.0.6",
"dependencies": {},

@@ -22,0 +22,0 @@ "devDependencies": {

@@ -152,3 +152,5 @@ var should = require('should');

humanize.relativeTime(humanize.time() - 1).should.equal('just now');
humanize.relativeTime(humanize.time() - .5).should.equal('just now');
humanize.relativeTime(humanize.time()).should.equal('just now');
humanize.relativeTime(humanize.time() + .5).should.equal('now');
humanize.relativeTime(humanize.time() + 1).should.equal('now');

@@ -160,5 +162,7 @@ });

humanize.relativeTime(humanize.time() - 37).should.equal('37 seconds ago');
humanize.relativeTime(humanize.time() - 37.3).should.equal('37 seconds ago');
humanize.relativeTime(humanize.time() - 2).should.equal('2 seconds ago');
humanize.relativeTime(humanize.time() + 2).should.equal('in 2 seconds');
humanize.relativeTime(humanize.time() + 22).should.equal('in 22 seconds');
humanize.relativeTime(humanize.time() + 22.7).should.equal('in 22 seconds');
humanize.relativeTime(humanize.time() + 59).should.equal('in 59 seconds');

@@ -252,15 +256,14 @@ });

var june1 = (new Date(d.getFullYear(), 6, 1));
var june1 = (new Date(d.getFullYear(), 5, 1));
var yearsAgo2 = (new Date(june1.getFullYear() - 2, d.getMonth() + 6, d.getDate() + 19)).getTime() / 1000;
var yearsAgo2 = (new Date(june1.getFullYear() - 2, june1.getMonth() + 6, june1.getDate() + 19)).getTime() / 1000;
humanize.relativeTime(yearsAgo2).should.equal('2 years ago');
var wrapToYearsAgo1 = (new Date(june1.getFullYear() - 2, d.getMonth() + 7, d.getDate() + 19)).getTime() / 1000;
var wrapToYearsAgo1 = (new Date(june1.getFullYear() - 2, june1.getMonth() + 7, june1.getDate() + 19)).getTime() / 1000;
humanize.relativeTime(wrapToYearsAgo1).should.equal('a year ago');
var yearsFuture2 = (new Date(june1.getFullYear() + 2, d.getMonth() + 6, d.getDate() + 19)).getTime() / 1000;
var yearsFuture2 = (new Date(june1.getFullYear() + 2, june1.getMonth() + 6, june1.getDate() + 19)).getTime() / 1000;
humanize.relativeTime(yearsFuture2).should.equal('in 2 years');
var wrapToYearsFuture1 = (new Date(june1.getFullYear() + 2, d.getMonth() - 7, d.getDate() + 19)).getTime() / 1000;
var wrapToYearsFuture1 = (new Date(june1.getFullYear() + 2, june1.getMonth() - 7, june1.getDate() + 19)).getTime() / 1000;
humanize.relativeTime(wrapToYearsFuture1).should.equal('in a year');

@@ -267,0 +270,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc