dateformat
Advanced tools
Comparing version 1.0.6-1.2.3 to 1.0.7-1.2.3
@@ -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 @@ |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
12505
8
0
209
0
80
0