Socket
Socket
Sign inDemoInstall

moment-parseplus

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

5

CHANGELOG.md
## Change Log
### v1.1.1 on 2018-03-14
- Updated dependencies and tested working with moment 2.21
- Updated unit tests to allow for daylight savings change
### v1.1.0 on 2017-12-02

@@ -4,0 +9,0 @@

4

package.json
{
"name": "moment-parseplus",
"version": "1.1.0",
"version": "1.1.1",
"description": "Date parsing plugin for momentjs",

@@ -36,3 +36,3 @@ "main": "parseplus.js",

"dependencies": {
"moment": "^2.6.0"
"moment": "^2.21.0"
},

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

# moment-parseplus
[![Build Status](https://travis-ci.org/kensnyder/moment-parseplus.svg?branch=master&v=1.1.0)](https://travis-ci.org/kensnyder/moment-parseplus)
[![Code Coverage](https://codecov.io/gh/kensnyder/moment-parseplus/branch/master/graph/badge.svg?v=1.1.0)](https://codecov.io/gh/kensnyder/moment-parseplus)
[![MIT License](https://img.shields.io/npm/l/express.svg?v=1.1.0)](https://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/kensnyder/moment-parseplus.svg?branch=master&v=1.1.1)](https://travis-ci.org/kensnyder/moment-parseplus)
[![Code Coverage](https://codecov.io/gh/kensnyder/moment-parseplus/branch/master/graph/badge.svg?v=1.1.1)](https://codecov.io/gh/kensnyder/moment-parseplus)
[![MIT License](https://img.shields.io/npm/l/express.svg?v=1.1.1)](https://opensource.org/licenses/MIT)

@@ -7,0 +7,0 @@ An extensible date parsing plugin for [momentjs](http://momentjs.com)

@@ -7,15 +7,18 @@ var moment = require('moment');

// due to daylight savings changes, it is simplest to just check a given range
var hourPlus100ms = 60*60*1000 + 100;
it("should parse times like `+5 hours`", function () {
expect(+moment('+5 hours')).to.be.closeTo(+new Date()+5*60*60*1000, 100);
expect(+moment('+5 hours')).to.be.closeTo(+new Date()+5*60*60*1000, hourPlus100ms);
});
it("should parse times like `+ 20 days`", function () {
expect(+moment('+ 20 days')).to.be.closeTo(+new Date()+20*24*60*60*1000, 100);
expect(+moment('+ 20 days')).to.be.closeTo(+new Date()+20*24*60*60*1000, hourPlus100ms);
});
it("should parse times like `-1 day`", function () {
expect(+moment('-1 day')).to.be.closeTo(+new Date()-24*60*60*1000, 100);
expect(+moment('-1 day')).to.be.closeTo(+new Date()-24*60*60*1000, hourPlus100ms);
});
it("should parse times like `-3days`", function () {
expect(+moment('-3days')).to.be.closeTo(+new Date()-3*24*60*60*1000, 100);
expect(+moment('-3days')).to.be.closeTo(+new Date()-3*24*60*60*1000, hourPlus100ms);
});
});
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