Comparing version 0.7.0 to 0.8.0
@@ -9,3 +9,3 @@ | ||
, path = require('path') | ||
, bindings = require('./time.node') | ||
, bindings = require('bindings')('time.node') | ||
, MILLIS_PER_SECOND = 1000 | ||
@@ -12,0 +12,0 @@ , DAYS_OF_WEEK = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'] |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["date", "time", "time.h", "timezone", "setTimezone", "getTimezone"], | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"repository": { | ||
@@ -17,4 +17,3 @@ "type": "git", | ||
"scripts": { | ||
"preinstall": "node-waf clean || true; node-waf configure build", | ||
"test": "mocha" | ||
"test": "mocha --reporter spec" | ||
}, | ||
@@ -25,3 +24,4 @@ "engines": { | ||
"dependencies": { | ||
"debug": "*" | ||
"bindings": "*" | ||
, "debug": "*" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
node-time | ||
========= | ||
### "[time.h][]" bindings for [NodeJS][Node]. | ||
[![Build Status](https://secure.travis-ci.org/TooTallNate/node-time.png)](http://travis-ci.org/TooTallNate/node-time) | ||
[![Build Status](https://secure.travis-ci.org/TooTallNate/node-time.png?branch=master)](http://travis-ci.org/TooTallNate/node-time) | ||
@@ -126,4 +126,3 @@ | ||
Returns the abbreviated timezone name, also taking daylight savings into consideration. | ||
Useful for the presentation layer of a Date instance. This is a _NON-STANDARD_ extension | ||
to the Date object. | ||
Useful for the presentation layer of a Date instance. | ||
@@ -130,0 +129,0 @@ ``` javascript |
@@ -5,2 +5,3 @@ var should = require('should') | ||
describe('Date', function () { | ||
describe('#setTimezone()', function () { | ||
@@ -26,3 +27,3 @@ | ||
it('should match the UTC values', function () { | ||
it('should match the UTC values when set to "UTC"', function () { | ||
var d = new time.Date | ||
@@ -60,4 +61,10 @@ d.setTimezone('UTC') | ||
it('should keep local values, but change the timezone', function () { | ||
it('should change the timezone', function () { | ||
var d = new time.Date | ||
d.setTimezone('US/Pacific', true) | ||
d.getTimezone().should.not.equal(process.env.TZ) | ||
}) | ||
it('should keep local values', function () { | ||
var d = new time.Date | ||
, millis = d.getMilliseconds() | ||
@@ -80,4 +87,9 @@ , seconds = d.getSeconds() | ||
d.getFullYear().should.equal(year) | ||
d.getTimezone().should.not.equal(process.env.TZ) | ||
}) | ||
it('should change the date\'s internal time value', function () { | ||
var d = new time.Date | ||
, old = d.getTime() | ||
d.setTimezone('US/Pacific', true) | ||
d.getTime().should.not.equal(old) | ||
}) | ||
@@ -84,0 +96,0 @@ |
@@ -31,3 +31,3 @@ var should = require('should') | ||
it('should throw if in invalid object is passed into it', function () { | ||
should.throws(time) | ||
time.should.throw() | ||
}) | ||
@@ -51,2 +51,19 @@ | ||
it('should return a real "Date" instance', function () { | ||
var d = new time.Date | ||
Object.prototype.toString.call(d).should.equal('[object Date]') | ||
}) | ||
it('should pass `time.Date` instanceof', function () { | ||
var d = new time.Date | ||
, test = d instanceof time.Date | ||
test.should.be.true | ||
}) | ||
it('should not pass global instanceof', function () { | ||
var d = new time.Date | ||
, test = d instanceof Date | ||
test.should.be.false | ||
}) | ||
it('should already have the node-time extensions', function () { | ||
@@ -53,0 +70,0 @@ should.exist(time.Date.prototype.setTimezone) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
41718
15
685
0
2
3
225
2
+ Addedbindings@*
+ Addedbindings@1.5.0(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)