This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
d3-time.v1.min.js
2 lines (2 loc) · 5.45 KB
/
d3-time.v1.min.js
1
2
// https://d3js.org/d3-time/ Version 1.0.6. Copyright 2017 Mike Bostock.
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.d3=e.d3||{})}(this,function(e){"use strict";function t(e,n,u,i){function a(t){return e(t=new Date(+t)),t}return a.floor=a,a.ceil=function(t){return e(t=new Date(t-1)),n(t,1),e(t),t},a.round=function(e){var t=a(e),n=a.ceil(e);return e-t<n-e?t:n},a.offset=function(e,t){return n(e=new Date(+e),null==t?1:Math.floor(t)),e},a.range=function(t,u,r){var o=[];if(t=a.ceil(t),r=null==r?1:Math.floor(r),!(t<u&&r>0))return o;do{o.push(new Date(+t))}while(n(t,r),e(t),t<u);return o},a.filter=function(u){return t(function(t){if(t>=t)for(;e(t),!u(t);)t.setTime(t-1)},function(e,t){if(e>=e)for(;--t>=0;)for(;n(e,1),!u(e););})},u&&(a.count=function(t,n){return r.setTime(+t),o.setTime(+n),e(r),e(o),Math.floor(u(r,o))},a.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?a.filter(i?function(t){return i(t)%e==0}:function(t){return a.count(0,t)%e==0}):a:null}),a}function n(e){return t(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*c)/s})}function u(e){return t(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/s})}var r=new Date,o=new Date,i=t(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?t(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):i:null};var a=i.range,c=6e4,s=6048e5,f=t(function(e){e.setTime(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),l=f.range,g=t(function(e){e.setTime(Math.floor(e/c)*c)},function(e,t){e.setTime(+e+t*c)},function(e,t){return(t-e)/c},function(e){return e.getMinutes()}),T=g.range,d=t(function(e){var t=e.getTimezoneOffset()*c%36e5;t<0&&(t+=36e5),e.setTime(36e5*Math.floor((+e-t)/36e5)+t)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),m=d.range,M=t(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*c)/864e5},function(e){return e.getDate()-1}),y=M.range,h=n(0),C=n(1),U=n(2),F=n(3),D=n(4),Y=n(5),H=n(6),S=h.range,v=C.range,p=U.range,W=F.range,w=D.range,O=Y.range,z=H.range,k=t(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())},function(e){return e.getMonth()}),x=k.range,b=t(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});b.every=function(e){return isFinite(e=Math.floor(e))&&e>0?t(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null};var j=b.range,_=t(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*c)},function(e,t){return(t-e)/c},function(e){return e.getUTCMinutes()}),I=_.range,P=t(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()}),q=P.range,A=t(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1}),B=A.range,E=u(0),G=u(1),J=u(2),K=u(3),L=u(4),N=u(5),Q=u(6),R=E.range,V=G.range,X=J.range,Z=K.range,$=L.range,ee=N.range,te=Q.range,ne=t(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()}),ue=ne.range,re=t(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});re.every=function(e){return isFinite(e=Math.floor(e))&&e>0?t(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null};var oe=re.range;e.timeInterval=t,e.timeMillisecond=i,e.timeMilliseconds=a,e.utcMillisecond=i,e.utcMilliseconds=a,e.timeSecond=f,e.timeSeconds=l,e.utcSecond=f,e.utcSeconds=l,e.timeMinute=g,e.timeMinutes=T,e.timeHour=d,e.timeHours=m,e.timeDay=M,e.timeDays=y,e.timeWeek=h,e.timeWeeks=S,e.timeSunday=h,e.timeSundays=S,e.timeMonday=C,e.timeMondays=v,e.timeTuesday=U,e.timeTuesdays=p,e.timeWednesday=F,e.timeWednesdays=W,e.timeThursday=D,e.timeThursdays=w,e.timeFriday=Y,e.timeFridays=O,e.timeSaturday=H,e.timeSaturdays=z,e.timeMonth=k,e.timeMonths=x,e.timeYear=b,e.timeYears=j,e.utcMinute=_,e.utcMinutes=I,e.utcHour=P,e.utcHours=q,e.utcDay=A,e.utcDays=B,e.utcWeek=E,e.utcWeeks=R,e.utcSunday=E,e.utcSundays=R,e.utcMonday=G,e.utcMondays=V,e.utcTuesday=J,e.utcTuesdays=X,e.utcWednesday=K,e.utcWednesdays=Z,e.utcThursday=L,e.utcThursdays=$,e.utcFriday=N,e.utcFridays=ee,e.utcSaturday=Q,e.utcSaturdays=te,e.utcMonth=ne,e.utcMonths=ue,e.utcYear=re,e.utcYears=oe,Object.defineProperty(e,"__esModule",{value:!0})});