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

d3-time

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-time - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

36

build/d3-time.js

@@ -1,2 +0,2 @@

// https://d3js.org/d3-time/ Version 0.3.1. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-time/ Version 0.3.2. Copyright 2016 Mike Bostock.
(function (global, factory) {

@@ -151,4 +151,4 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

return newInterval(function(date) {
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
date.setHours(0, 0, 0, 0);
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
}, function(date, step) {

@@ -178,4 +178,4 @@ date.setDate(date.getDate() + step * 7);

var month = newInterval(function(date) {
date.setDate(1);
date.setHours(0, 0, 0, 0);
date.setDate(1);
}, function(date, step) {

@@ -192,4 +192,4 @@ date.setMonth(date.getMonth() + step);

var year = newInterval(function(date) {
date.setMonth(0, 1);
date.setHours(0, 0, 0, 0);
date.setMonth(0, 1);
}, function(date, step) {

@@ -203,2 +203,13 @@ date.setFullYear(date.getFullYear() + step);

// An optimized implementation for this simple case.
year.every = function(k) {
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
date.setMonth(0, 1);
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setFullYear(date.getFullYear() + step * k);
});
};
var years = year.range;

@@ -244,4 +255,4 @@

return newInterval(function(date) {
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
date.setUTCHours(0, 0, 0, 0);
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
}, function(date, step) {

@@ -271,4 +282,4 @@ date.setUTCDate(date.getUTCDate() + step * 7);

var utcMonth = newInterval(function(date) {
date.setUTCDate(1);
date.setUTCHours(0, 0, 0, 0);
date.setUTCDate(1);
}, function(date, step) {

@@ -285,4 +296,4 @@ date.setUTCMonth(date.getUTCMonth() + step);

var utcYear = newInterval(function(date) {
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
date.setUTCMonth(0, 1);
}, function(date, step) {

@@ -296,2 +307,13 @@ date.setUTCFullYear(date.getUTCFullYear() + step);

// An optimized implementation for this simple case.
utcYear.every = function(k) {
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCFullYear(date.getUTCFullYear() + step * k);
});
};
var utcYears = utcYear.range;

@@ -298,0 +320,0 @@

4

build/d3-time.min.js

@@ -1,2 +0,2 @@

// https://d3js.org/d3-time/ Version 0.3.1. Copyright 2016 Mike Bostock.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,n,u,o){function c(e){return t(e=new Date(+e)),e}return c.floor=c,c.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},c.round=function(t){var e=c(t),n=c.ceil(t);return n-t>t-e?e:n},c.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},c.range=function(e,u,r){var i=[];if(e=c.ceil(e),r=null==r?1:Math.floor(r),!(u>e&&r>0))return i;do i.push(new Date(+e));while(n(e,r),t(e),u>e);return i},c.filter=function(u){return e(function(e){for(;t(e),!u(e);)e.setTime(e-1)},function(t,e){for(;--e>=0;)for(;n(t,1),!u(t););})},u&&(c.count=function(e,n){return r.setTime(+e),i.setTime(+n),t(r),t(i),Math.floor(u(r,i))},c.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?c.filter(o?function(e){return o(e)%t===0}:function(e){return c.count(0,e)%t===0}):c:null}),c}function n(t){return e(function(e){e.setHours(0,0,0,0),e.setDate(e.getDate()-(e.getDay()+7-t)%7)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/l})}function u(t){return e(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/l})}var r=new Date,i=new Date,o=e(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});o.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?e(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):o:null};var c=o.range,a=1e3,s=6e4,f=36e5,g=864e5,l=6048e5,T=e(function(t){t.setTime(Math.floor(t/a)*a)},function(t,e){t.setTime(+t+e*a)},function(t,e){return(e-t)/a},function(t){return t.getUTCSeconds()}),d=T.range,m=e(function(t){t.setTime(Math.floor(t/s)*s)},function(t,e){t.setTime(+t+e*s)},function(t,e){return(e-t)/s},function(t){return t.getMinutes()}),M=m.range,y=e(function(t){var e=t.getTimezoneOffset()*s%f;0>e&&(e+=f),t.setTime(Math.floor((+t-e)/f)*f+e)},function(t,e){t.setTime(+t+e*f)},function(t,e){return(e-t)/f},function(t){return t.getHours()}),h=y.range,C=e(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/g},function(t){return t.getDate()-1}),U=C.range,D=n(0),F=n(1),Y=n(2),H=n(3),S=n(4),v=n(5),p=n(6),W=D.range,w=F.range,O=Y.range,z=H.range,k=S.range,x=v.range,b=p.range,j=e(function(t){t.setHours(0,0,0,0),t.setDate(1)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),_=j.range,I=e(function(t){t.setHours(0,0,0,0),t.setMonth(0,1)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()}),P=I.range,q=e(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*s)},function(t,e){return(e-t)/s},function(t){return t.getUTCMinutes()}),A=q.range,B=e(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*f)},function(t,e){return(e-t)/f},function(t){return t.getUTCHours()}),E=B.range,G=e(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/g},function(t){return t.getUTCDate()-1}),J=G.range,K=u(0),L=u(1),N=u(2),Q=u(3),R=u(4),V=u(5),X=u(6),Z=K.range,$=L.range,tt=N.range,et=Q.range,nt=R.range,ut=V.range,rt=X.range,it=e(function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(1)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),ot=it.range,ct=e(function(t){t.setUTCHours(0,0,0,0),t.setUTCMonth(0,1)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()}),at=ct.range;t.timeInterval=e,t.timeMillisecond=o,t.timeMilliseconds=c,t.utcMillisecond=o,t.utcMilliseconds=c,t.timeSecond=T,t.timeSeconds=d,t.utcSecond=T,t.utcSeconds=d,t.timeMinute=m,t.timeMinutes=M,t.timeHour=y,t.timeHours=h,t.timeDay=C,t.timeDays=U,t.timeWeek=D,t.timeWeeks=W,t.timeSunday=D,t.timeSundays=W,t.timeMonday=F,t.timeMondays=w,t.timeTuesday=Y,t.timeTuesdays=O,t.timeWednesday=H,t.timeWednesdays=z,t.timeThursday=S,t.timeThursdays=k,t.timeFriday=v,t.timeFridays=x,t.timeSaturday=p,t.timeSaturdays=b,t.timeMonth=j,t.timeMonths=_,t.timeYear=I,t.timeYears=P,t.utcMinute=q,t.utcMinutes=A,t.utcHour=B,t.utcHours=E,t.utcDay=G,t.utcDays=J,t.utcWeek=K,t.utcWeeks=Z,t.utcSunday=K,t.utcSundays=Z,t.utcMonday=L,t.utcMondays=$,t.utcTuesday=N,t.utcTuesdays=tt,t.utcWednesday=Q,t.utcWednesdays=et,t.utcThursday=R,t.utcThursdays=nt,t.utcFriday=V,t.utcFridays=ut,t.utcSaturday=X,t.utcSaturdays=rt,t.utcMonth=it,t.utcMonths=ot,t.utcYear=ct,t.utcYears=at,Object.defineProperty(t,"__esModule",{value:!0})});
// https://d3js.org/d3-time/ Version 0.3.2. Copyright 2016 Mike Bostock.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,n,u,i){function a(e){return t(e=new Date(+e)),e}return a.floor=a,a.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},a.round=function(t){var e=a(t),n=a.ceil(t);return n-t>t-e?e:n},a.offset=function(t,e){return n(t=new Date(+t),null==e?1:Math.floor(e)),t},a.range=function(e,u,r){var o=[];if(e=a.ceil(e),r=null==r?1:Math.floor(r),!(u>e&&r>0))return o;do o.push(new Date(+e));while(n(e,r),t(e),u>e);return o},a.filter=function(u){return e(function(e){for(;t(e),!u(e);)e.setTime(e-1)},function(t,e){for(;--e>=0;)for(;n(t,1),!u(t););})},u&&(a.count=function(e,n){return r.setTime(+e),o.setTime(+n),t(r),t(o),Math.floor(u(r,o))},a.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?a.filter(i?function(e){return i(e)%t===0}:function(e){return a.count(0,e)%t===0}):a:null}),a}function n(t){return e(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+7*e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/g})}function u(t){return e(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+7*e)},function(t,e){return(e-t)/g})}var r=new Date,o=new Date,i=e(function(){},function(t,e){t.setTime(+t+e)},function(t,e){return e-t});i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?e(function(e){e.setTime(Math.floor(e/t)*t)},function(e,n){e.setTime(+e+n*t)},function(e,n){return(n-e)/t}):i:null};var a=i.range,c=1e3,s=6e4,f=36e5,l=864e5,g=6048e5,T=e(function(t){t.setTime(Math.floor(t/c)*c)},function(t,e){t.setTime(+t+e*c)},function(t,e){return(e-t)/c},function(t){return t.getUTCSeconds()}),d=T.range,m=e(function(t){t.setTime(Math.floor(t/s)*s)},function(t,e){t.setTime(+t+e*s)},function(t,e){return(e-t)/s},function(t){return t.getMinutes()}),M=m.range,y=e(function(t){var e=t.getTimezoneOffset()*s%f;0>e&&(e+=f),t.setTime(Math.floor((+t-e)/f)*f+e)},function(t,e){t.setTime(+t+e*f)},function(t,e){return(e-t)/f},function(t){return t.getHours()}),h=y.range,C=e(function(t){t.setHours(0,0,0,0)},function(t,e){t.setDate(t.getDate()+e)},function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*s)/l},function(t){return t.getDate()-1}),U=C.range,F=n(0),D=n(1),Y=n(2),H=n(3),S=n(4),v=n(5),p=n(6),W=F.range,w=D.range,O=Y.range,z=H.range,k=S.range,x=v.range,b=p.range,j=e(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,e){t.setMonth(t.getMonth()+e)},function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),_=j.range,I=e(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t,e){return e.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});I.every=function(t){return isFinite(t=Math.floor(t))&&t>0?e(function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,n){e.setFullYear(e.getFullYear()+n*t)}):null};var P=I.range,q=e(function(t){t.setUTCSeconds(0,0)},function(t,e){t.setTime(+t+e*s)},function(t,e){return(e-t)/s},function(t){return t.getUTCMinutes()}),A=q.range,B=e(function(t){t.setUTCMinutes(0,0,0)},function(t,e){t.setTime(+t+e*f)},function(t,e){return(e-t)/f},function(t){return t.getUTCHours()}),E=B.range,G=e(function(t){t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCDate(t.getUTCDate()+e)},function(t,e){return(e-t)/l},function(t){return t.getUTCDate()-1}),J=G.range,K=u(0),L=u(1),N=u(2),Q=u(3),R=u(4),V=u(5),X=u(6),Z=K.range,$=L.range,tt=N.range,et=Q.range,nt=R.range,ut=V.range,rt=X.range,ot=e(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCMonth(t.getUTCMonth()+e)},function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),it=ot.range,at=e(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)},function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});at.every=function(t){return isFinite(t=Math.floor(t))&&t>0?e(function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)}):null};var ct=at.range;t.timeInterval=e,t.timeMillisecond=i,t.timeMilliseconds=a,t.utcMillisecond=i,t.utcMilliseconds=a,t.timeSecond=T,t.timeSeconds=d,t.utcSecond=T,t.utcSeconds=d,t.timeMinute=m,t.timeMinutes=M,t.timeHour=y,t.timeHours=h,t.timeDay=C,t.timeDays=U,t.timeWeek=F,t.timeWeeks=W,t.timeSunday=F,t.timeSundays=W,t.timeMonday=D,t.timeMondays=w,t.timeTuesday=Y,t.timeTuesdays=O,t.timeWednesday=H,t.timeWednesdays=z,t.timeThursday=S,t.timeThursdays=k,t.timeFriday=v,t.timeFridays=x,t.timeSaturday=p,t.timeSaturdays=b,t.timeMonth=j,t.timeMonths=_,t.timeYear=I,t.timeYears=P,t.utcMinute=q,t.utcMinutes=A,t.utcHour=B,t.utcHours=E,t.utcDay=G,t.utcDays=J,t.utcWeek=K,t.utcWeeks=Z,t.utcSunday=K,t.utcSundays=Z,t.utcMonday=L,t.utcMondays=$,t.utcTuesday=N,t.utcTuesdays=tt,t.utcWednesday=Q,t.utcWednesdays=et,t.utcThursday=R,t.utcThursdays=nt,t.utcFriday=V,t.utcFridays=ut,t.utcSaturday=X,t.utcSaturdays=rt,t.utcMonth=ot,t.utcMonths=it,t.utcYear=at,t.utcYears=ct,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "d3-time",
"version": "0.3.1",
"version": "0.3.2",
"description": "A calculator for humanity’s peculiar conventions of time.",

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

import interval from "./interval";
var month = interval(function(date) {
date.setDate(1);
date.setHours(0, 0, 0, 0);
date.setDate(1);
}, function(date, step) {

@@ -7,0 +7,0 @@ date.setMonth(date.getMonth() + step);

import interval from "./interval";
var utcMonth = interval(function(date) {
date.setUTCDate(1);
date.setUTCHours(0, 0, 0, 0);
date.setUTCDate(1);
}, function(date, step) {

@@ -7,0 +7,0 @@ date.setUTCMonth(date.getUTCMonth() + step);

@@ -6,4 +6,4 @@ import interval from "./interval";

return interval(function(date) {
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
date.setUTCHours(0, 0, 0, 0);
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
}, function(date, step) {

@@ -10,0 +10,0 @@ date.setUTCDate(date.getUTCDate() + step * 7);

import interval from "./interval";
var utcYear = interval(function(date) {
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
date.setUTCMonth(0, 1);
}, function(date, step) {

@@ -14,3 +14,14 @@ date.setUTCFullYear(date.getUTCFullYear() + step);

// An optimized implementation for this simple case.
utcYear.every = function(k) {
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCFullYear(date.getUTCFullYear() + step * k);
});
};
export default utcYear;
export var utcYears = utcYear.range;

@@ -6,4 +6,4 @@ import interval from "./interval";

return interval(function(date) {
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
date.setHours(0, 0, 0, 0);
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
}, function(date, step) {

@@ -10,0 +10,0 @@ date.setDate(date.getDate() + step * 7);

import interval from "./interval";
var year = interval(function(date) {
date.setMonth(0, 1);
date.setHours(0, 0, 0, 0);
date.setMonth(0, 1);
}, function(date, step) {

@@ -14,3 +14,14 @@ date.setFullYear(date.getFullYear() + step);

// An optimized implementation for this simple case.
year.every = function(k) {
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : interval(function(date) {
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
date.setMonth(0, 1);
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setFullYear(date.getFullYear() + step * k);
});
};
export default year;
export var years = year.range;
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