Socket
Socket
Sign inDemoInstall

date-format

Package Overview
Dependencies
0
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.10 to 4.0.11

9

CHANGELOG.md
# date-format Changelog
## 4.0.11
- [fix: date parsing errors (wrong month due to days overflow)](https://github.com/nomiddlename/date-format/pull/68) - thanks [@peteriman](https://github.com/peteriman)
- [test: use new Date(0) instead of new Date() before setting every field]() - thanks [@peteriman](https://github.com/peteriman)
- [chore(deps-dev): updated dependencies](https://github.com/nomiddlename/date-format/pull/70) - thanks [@peteriman](https://github.com/peteriman)
- chore(deps-dev): bump eslint from 8.15.0 to 8.16.0
- chore(deps-dev): bump eslint-plugin-mocha from 10.0.4 to 10.0.5
- chore(deps-dev): updated package-lock.json
## 4.0.10

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

13

lib/index.js

@@ -73,2 +73,3 @@ "use strict";

var local = pattern.indexOf('O') < 0;
var monthOverflow = false;
var matchers = [

@@ -87,2 +88,7 @@ {

setDatePart(date, 'Month', (value - 1), local);
if (date.getMonth() !== (value - 1)) {
// in the event of 31 May --> 31 Feb --> 3 Mar
// this is correct behavior if no Date is involved
monthOverflow = true;
}
}

@@ -94,2 +100,7 @@ },

fn: function(date, value) {
// in the event of 31 May --> 31 Feb --> 3 Mar
// reset Mar back to Feb, before setting the Date
if (monthOverflow) {
setDatePart(date, 'Month', (date.getMonth() - 1), local);
}
setDatePart(date, 'Date', value, local);

@@ -155,3 +166,3 @@ }

//
// Note: the time zone has to be processed after all other fileds are
// Note: the time zone has to be processed after all other fields are
// set. The result would be incorrect if the offset was calculated

@@ -158,0 +169,0 @@ // first then overriden by the other filed setters.

6

package.json
{
"name": "date-format",
"version": "4.0.10",
"version": "4.0.11",
"description": "Formatting Date objects as strings since 2013",

@@ -32,4 +32,4 @@ "main": "lib/index.js",

"devDependencies": {
"eslint": "^8.15.0",
"eslint-plugin-mocha": "^10.0.4",
"eslint": "^8.16.0",
"eslint-plugin-mocha": "^10.0.5",
"mocha": "^10.0.0",

@@ -36,0 +36,0 @@ "nyc": "^15.1.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