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.7.0 to 0.8.0

.npmignore

2

index.js

@@ -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

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