Socket
Socket
Sign inDemoInstall

date-fns

Package Overview
Dependencies
0
Maintainers
1
Versions
200
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

src/__tests__/end_of_day_test.js

9

CHANGELOG.md
# Changelog
## v0.3.0 (6 Oct 2014)
* Additions:
- `endOfDay`
- `startOfMonth`
- `endOfMonth`
* Improvements:
- `startOfDay` now sets milliseconds as well
## v0.2.0 (6 Oct 2014)

@@ -4,0 +13,0 @@

2

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

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

@@ -11,3 +11,6 @@ # date-fns

* [`isToday`](./src/is_today.js) - is passed date is today?;
* [`startOfDay`](./src/start_of_day.js) - returns start of day for passed date;
* [`startOfDay`](./src/start_of_day.js) - returns start of a day for passed date;
* [`endOfDay`](./src/end_of_day.js) - returns end of a day for passed date;
* [`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;

@@ -7,3 +7,5 @@ var startOfDay = require('../start_of_day');

var result = startOfDay(date);
expect(result).to.be.eql(new Date(2014, 8 /* starts from 0 */, 2));
expect(result).to.be.eql(
new Date(2014, 8 /* starts from 0 */, 2, 0, 0, 0, 0)
);
});

@@ -14,3 +16,5 @@

var result = startOfDay(date);
expect(result).to.be.eql(new Date(2014, 8 /* starts from 0 */, 2));
expect(result).to.be.eql(
new Date(2014, 8 /* starts from 0 */, 2, 0, 0, 0, 0)
);
});

@@ -17,0 +21,0 @@

/**
* Returns start of the day for given date. Date will be in local
* timezone.
* Returns start of a day for given date. Date will be in local timezone.
* @param {date|string} dirtyDate

@@ -9,5 +8,3 @@ * @returns {date}

var date = new Date(dirtyDate);
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setHours(0, 0, 0, 0);
return date;

@@ -14,0 +11,0 @@ };

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