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

chronoshift

Package Overview
Dependencies
Maintainers
0
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.10.1 to 0.10.2

6

build/duration/duration.js

@@ -232,2 +232,8 @@ "use strict";

};
Duration.prototype.ceil = function (date, timezone) {
var floored = this.floor(date, timezone);
if (floored.valueOf() === date.valueOf())
return date;
return this.shift(floored, timezone, 1);
};
Duration.prototype.shift = function (date, timezone, step) {

@@ -234,0 +240,0 @@ if (step === void 0) { step = 1; }

@@ -229,2 +229,8 @@ import { second, shifters } from '../floor-shift-ceil/floor-shift-ceil';

};
Duration.prototype.ceil = function (date, timezone) {
var floored = this.floor(date, timezone);
if (floored.valueOf() === date.valueOf())
return date;
return this.shift(floored, timezone, 1);
};
Duration.prototype.shift = function (date, timezone, step) {

@@ -231,0 +237,0 @@ if (step === void 0) { step = 1; }

4

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

@@ -46,3 +46,3 @@ "keywords": [

"volta": {
"node": "12.22.10"
"node": "14.21.3"
},

@@ -49,0 +49,0 @@ "jest": {

@@ -293,2 +293,13 @@ /*

/**
* Ceilings the date according to this duration
* @param date The date to ceiling
* @param timezone The timezone within which to ceiling
*/
public ceil(date: Date, timezone: Timezone): Date {
const floored = this.floor(date, timezone);
if (floored.valueOf() === date.valueOf()) return date; // Just like ceil(3) is 3 and not 4
return this.shift(floored, timezone, 1);
}
/**
* Moves the given date by 'step' times of the duration

@@ -295,0 +306,0 @@ * Negative step value will move back in time.

@@ -32,2 +32,3 @@ import type { Instance } from 'immutable-class';

floor(date: Date, timezone: Timezone): Date;
ceil(date: Date, timezone: Timezone): Date;
shift(date: Date, timezone: Timezone, step?: number): Date;

@@ -34,0 +35,0 @@ materialize(start: Date, end: Date, timezone: Timezone, step?: number): Date[];

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