Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

time

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time - npm Package Compare versions

Comparing version 0.8.1 to 0.8.2

4

index.js

@@ -501,4 +501,4 @@

// set time given timezone relative to the currently set local time
// (changing the internal "time" milliseconds value)
d.setTimezone(timezone, true);
// (changing the internal "time" milliseconds value unless ms specified)
d.setTimezone(timezone, !(argc == 1 && typeof year === 'number'));
}

@@ -505,0 +505,0 @@ return d;

@@ -5,3 +5,3 @@ {

"keywords": ["date", "time", "time.h", "timezone", "setTimezone", "getTimezone"],
"version": "0.8.1",
"version": "0.8.2",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -6,2 +6,37 @@ var should = require('should')

describe('constructor', function() {
it('should parse strings relative to TZ', function() {
var d = new time.Date('2012-1-12 02:00 PM', 'America/New_York')
d.getTime().should.equal(1326394800000);
d.getTimezone().should.equal('America/New_York');
d = new time.Date('2012-1-12 02:00 PM', 'America/Los_Angeles')
d.getTime().should.equal(1326405600000);
d.getTimezone().should.equal('America/Los_Angeles');
})
it('should interpret date parts relative to TZ', function() {
var d = new time.Date(2012, 0, 12, 14, 'America/New_York')
d.getTime().should.equal(1326394800000);
d.getTimezone().should.equal('America/New_York');
var d = new time.Date(2012, 0, 12, 14, 'America/Los_Angeles')
d.getTime().should.equal(1326405600000);
d.getTimezone().should.equal('America/Los_Angeles');
})
it('should accept milliseconds regardless of TZ', function() {
var d1 = new time.Date(1352005200000, 'America/New_York');
var d2 = new time.Date(1352005200000, 'America/Los_Angeles');
d1.getTime().should.equal(d2.getTime());
d1.getTimezone().should.equal('America/New_York');
d2.getTimezone().should.equal('America/Los_Angeles');
})
})
describe('#setTimezone()', function () {

@@ -8,0 +43,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc