Comparing version 0.7.0 to 0.8.0
# 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 @@ |
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28726
46
730
29