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

date-fns

Package Overview
Dependencies
Maintainers
1
Versions
204
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-fns - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

src/__tests__/add_months_test.js

10

CHANGELOG.md
# Changelog
## v0.8.0 (9 Oct 2014)
* Additions:
- `addMonths`
- `subMonths`
- `setMonth`
- `setYear`
* Improvements:
- Reuse `addDays` inside of `subDays`
## v0.7.0 (8 Oct 2014)

@@ -4,0 +14,0 @@

2

package.json
{
"name": "date-fns",
"version": "0.7.0",
"version": "0.8.0",
"author": "Sasha Koss <kossnocorp@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Date helpers",

@@ -20,2 +20,4 @@ # date-fns

* [`subDays`](./src/sub_days.js) - substract specified number of days from passed date
* [`addMonths`](./src/add_months.js) - add specified number of months to passed date
* [`subMonths`](./src/sub_months.js) - substract specified number of days from passed date
* [`isSameWeek`](./src/is_same_week.js) - returns true if passed dates belongs to the same week

@@ -25,2 +27,4 @@ * [`isSameMonth`](./src/is_same_month.js) - returns true if passed dates has same month (and year)

* [`isLastDayOfMonth`](./src/is_last_day_of_month.js) - return true if passed date is last day of month
* [`setMonth`](./src/set_month.js) - sets month index
* [`setYear`](./src/set_year.js) - sets full year

@@ -0,1 +1,3 @@

var addDays = require('./add_days');
/**

@@ -8,5 +10,3 @@ * Substract specified number of days from passed date.

var subDays = function(dirtyDate, amount) {
var date = new Date(dirtyDate);
date.setDate(date.getDate() - amount);
return date;
return addDays(dirtyDate, -amount);
};

@@ -13,0 +13,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