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.8.0 to 0.9.0

src/__tests__/is_future_test.js

7

CHANGELOG.md
# Changelog
## v0.9.0 (10 Oct 2014)
* Additions:
- `isFuture`
* Improvements:
- Simplify `isWeekend`
## v0.8.0 (9 Oct 2014)

@@ -4,0 +11,0 @@

2

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

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

# date-fns
[![](http://img.shields.io/npm/v/date-fns.svg)](https://www.npmjs.org/package/date-fns)
[![Build Status](https://travis-ci.org/kossnocorp/date-fns.svg)](https://travis-ci.org/kossnocorp/date-fns)
Date helpers in function-per-file style.
## Installation
```
npm install --save date-fns
```
## Usage
``` javascript
var isLastDayOfMonth = require('date-fns/src/is_last_day_of_month');
var date = new Date(2014, 1, 28);
console.log(isLastDayOfMonth(date));
//=> true
```
## API

@@ -9,2 +26,10 @@

### Common helpers
* `format` - TODO
* `parse` - TODO
* [`isFuture`](./src/is_future.js) - is passed date is future?
### Day helpers
* [`isWeekend`](./src/is_weekend.js) - is passed date is weekend?

@@ -14,12 +39,18 @@ * [`isToday`](./src/is_today.js) - is passed date is today?

* [`endOfDay`](./src/end_of_day.js) - returns end of a day for passed date
* [`addDays`](./src/add_days.js) - add specified number of days to passed date
* [`subDays`](./src/sub_days.js) - substract specified number of days from passed date
* [`eachDay`](./src/each_day.js) - returns array of dates within specified range
### Week helpers
* [`startOfWeek`](./src/start_of_week.js) - returns start of a week for passed date
* [`endOfWeek`](./src/end_of_week.js) - returns end of a week for passed date
* [`isSameWeek`](./src/is_same_week.js) - returns true if passed dates belongs to the same week
### Month helpers
* [`startOfMonth`](./src/start_of_month.js) - returns start of a month for passed date
* [`endOfMonth`](./src/end_of_month.js) - returns end of a month for passed date
* [`eachDay`](./src/each_day.js) - returns array of dates within specified range
* [`addDays`](./src/add_days.js) - add specified number of days to passed date
* [`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
* [`isSameMonth`](./src/is_same_month.js) - returns true if passed dates has same month (and year)

@@ -29,3 +60,10 @@ * [`isFirstDayOfMonth`](./src/is_first_day_of_month.js) - return true if passed date is first day of month

* [`setMonth`](./src/set_month.js) - sets month index
### Year helpers
* [`setYear`](./src/set_year.js) - sets full year
### I18n
TODO

@@ -9,8 +9,3 @@ /**

var day = date.getDay();
if (day == 0 || day == 6) {
return true;
} else {
return false;
}
return day == 0 || day == 6;
};

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