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

@qrohlf/smart-date

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qrohlf/smart-date - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

es5.js

@@ -54,5 +54,3 @@ 'use strict';

{
var _start = moment().subtract(1, 'week');
var _end = moment().add(1, 'week');
return relative && m.isBetween(_start, _end);
return relative;
}

@@ -59,0 +57,0 @@ default:

@@ -45,5 +45,3 @@ const moment = require('moment')

case 'boolean': {
const start = moment().subtract(1, 'week')
const end = moment().add(1, 'week')
return relative && m.isBetween(start, end)
return relative
}

@@ -50,0 +48,0 @@ default: {

{
"name": "@qrohlf/smart-date",
"version": "1.1.0",
"version": "1.1.1",
"description": "Takes date objects. Returns sane human-readable strings.",

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

@@ -62,5 +62,5 @@ /* eslint-env mocha */

describe('relative option', () => {
it('defaults to 1 week for {relative: true}', () => {
expect(formatSingleDate('2016-06-22', {relative: true})).to.eql('June 22nd')
expect(formatSingleDate('2016-06-23', {relative: true})).to.eql('June 23rd')
it('displays all dates as relative for {relative: true}', () => {
expect(formatSingleDate('2014-05-30', {relative: true})).to.eql('2 years ago')
expect(formatSingleDate('2015-05-30', {relative: true})).to.eql('a year ago')
expect(formatSingleDate('2016-06-24', {relative: true})).to.eql('6 days ago')

@@ -75,6 +75,3 @@ expect(formatSingleDate('2016-06-25', {relative: true})).to.eql('5 days ago')

expect(formatSingleDate('2016-07-03', {relative: true})).to.eql('in 3 days')
expect(formatSingleDate('2016-07-04', {relative: true})).to.eql('in 4 days')
expect(formatSingleDate('2016-07-05', {relative: true})).to.eql('in 5 days')
expect(formatSingleDate('2016-07-06', {relative: true})).to.eql('in 6 days')
expect(formatSingleDate('2016-07-07', {relative: true})).to.eql('July 7th')
expect(formatSingleDate('2019-07-03', {relative: true})).to.eql('in 3 years')
})

@@ -81,0 +78,0 @@

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