Socket
Socket
Sign inDemoInstall

dateformat

Package Overview
Dependencies
0
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6-1.2.3 to 1.0.7-1.2.3

LICENSE

12

lib/dateformat.js

@@ -64,3 +64,3 @@ /*

// Regexes and supporting functions are cached through closure
return function (date, mask, utc) {
return function (date, mask, utc, gmt) {
var dF = dateFormat;

@@ -86,6 +86,10 @@

// Allow setting the utc argument via the mask
if (mask.slice(0, 4) == "UTC:") {
// Allow setting the utc/gmt argument via the mask
var maskSlice = mask.slice(0, 4);
if (maskSlice == "UTC:" || maskSlice == "GMT:") {
mask = mask.slice(4);
utc = true;
if (maskSlice == "GMT:") {
gmt = true;
}
}

@@ -130,3 +134,3 @@

TT: H < 12 ? "AM" : "PM",
Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
Z: gmt ? "GMT" : utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""),
o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),

@@ -133,0 +137,0 @@ S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],

@@ -12,3 +12,3 @@ {

],
"version": "1.0.6-1.2.3",
"version": "1.0.7-1.2.3",
"main": "./lib/dateformat",

@@ -19,3 +19,7 @@ "dependencies": {},

"node": "*"
},
"repository": {
"type": "git",
"url": "https://github.com/felixge/node-dateformat.git"
}
}

@@ -11,6 +11,12 @@ # dateformat

## Installation
```bash
$ npm install dateformat
```
## Usage
As taken from Steven's post, modified to match the Modifications listed above:
```js
var dateFormat = require('dateformat');

@@ -57,3 +63,3 @@ var now = new Date();

// ...Or add the prefix "UTC:" to your mask.
// ...Or add the prefix "UTC:" or "GMT:" to your mask.
dateFormat(now, "UTC:h:MM:ss TT Z");

@@ -69,3 +75,3 @@ // 10:46:21 PM UTC

// 6
```
## License

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