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

chronoshift

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chronoshift - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

5

build/chronoshift.js

@@ -75,3 +75,6 @@ /// <reference path="../typings/immutable-class.d.ts" />

ceil: function (dt, tz) {
return move(floor(dt, tz), tz, 1);
var floored = floor(dt, tz);
if (floored.valueOf() === dt.valueOf())
return dt; // Just like ceil(3) is 3 and not 4
return move(floored, tz, 1);
}

@@ -78,0 +81,0 @@ };

2

package.json
{
"name": "chronoshift",
"version": "0.3.3",
"version": "0.3.4",
"description": "A tiny library for shifting time with timezones",

@@ -5,0 +5,0 @@ "keywords": [

@@ -27,3 +27,5 @@ module Chronoshift {

ceil: (dt: Date, tz: Timezone) => {
return move(floor(dt, tz), tz, 1);
var floored = floor(dt, tz);
if (floored.valueOf() === dt.valueOf()) return dt; // Just like ceil(3) is 3 and not 4
return move(floored, tz, 1);
}

@@ -30,0 +32,0 @@ };

@@ -65,2 +65,10 @@ /// <reference path="../typings/mocha/mocha.d.ts" />

});
it("ceils day", function () {
var d1 = new Date("2014-12-11T22:11:57.469Z");
var d2 = new Date("2014-12-12T00:00:00.000Z");
expect(chronoshift.day.ceil(d1, tz)).to.eql(d2);
d1 = new Date("2014-12-08T00:00:00.000Z");
d2 = new Date("2014-12-08T00:00:00.000Z");
expect(chronoshift.day.ceil(d1, tz)).to.eql(d2);
});
it("moves week", function () {

@@ -67,0 +75,0 @@ var dates = [

@@ -83,2 +83,12 @@ /// <reference path="../typings/mocha/mocha.d.ts" />

it("ceils day", () => {
var d1 = new Date("2014-12-11T22:11:57.469Z");
var d2 = new Date("2014-12-12T00:00:00.000Z");
expect(chronoshift.day.ceil(d1, tz)).to.eql(d2);
d1 = new Date("2014-12-08T00:00:00.000Z");
d2 = new Date("2014-12-08T00:00:00.000Z");
expect(chronoshift.day.ceil(d1, tz)).to.eql(d2);
});
it("moves week", () => {

@@ -85,0 +95,0 @@ var dates: Date[] = [

Sorry, the diff of this file is too big to display

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