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

d3-time-format

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-time-format - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

src/index.js

2

dist/d3-time-format.js

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

// https://d3js.org/d3-time-format/ v2.1.2 Copyright 2018 Mike Bostock
// https://d3js.org/d3-time-format/ v2.1.3 Copyright 2018 Mike Bostock
(function (global, factory) {

@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-time')) :

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

// https://d3js.org/d3-time-format/ v2.1.2 Copyright 2018 Mike Bostock
// https://d3js.org/d3-time-format/ v2.1.3 Copyright 2018 Mike Bostock
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],t):t(e.d3=e.d3||{},e.d3)}(this,function(e,t){"use strict";function n(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function r(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function u(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}function c(e){var c=e.dateTime,i=e.date,a=e.time,f=e.periods,l=e.days,s=e.shortDays,g=e.months,ve=e.shortMonths,Me=y(f),Te=d(f),De=y(l),Ce=d(l),xe=y(s),Ue=d(s),pe=y(g),we=d(g),Se=y(ve),Ye=d(ve),Fe={a:function(e){return s[e.getDay()]},A:function(e){return l[e.getDay()]},b:function(e){return ve[e.getMonth()]},B:function(e){return g[e.getMonth()]},c:null,d:W,e:W,f:I,H:V,I:j,j:P,L:Q,m:J,M:O,p:function(e){return f[+(e.getHours()>=12)]},Q:he,s:me,S:X,u:N,U:B,V:_,w:$,W:q,x:null,X:null,y:z,Y:E,Z:R,"%":de},He={a:function(e){return s[e.getUTCDay()]},A:function(e){return l[e.getUTCDay()]},b:function(e){return ve[e.getUTCMonth()]},B:function(e){return g[e.getUTCMonth()]},c:null,d:k,e:k,f:ne,H:G,I:K,j:ee,L:te,m:re,M:ue,p:function(e){return f[+(e.getUTCHours()>=12)]},Q:he,s:me,S:ce,u:ie,U:oe,V:ae,w:fe,W:le,x:null,X:null,y:se,Y:ge,Z:ye,"%":de},Le={a:function(e,t,n){var r=xe.exec(t.slice(n));return r?(e.w=Ue[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=De.exec(t.slice(n));return r?(e.w=Ce[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=Se.exec(t.slice(n));return r?(e.m=Ye[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=pe.exec(t.slice(n));return r?(e.m=we[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,t,n){return be(e,c,t,n)},d:p,e:p,f:L,H:S,I:S,j:w,L:H,m:U,M:Y,p:function(e,t,n){var r=Me.exec(t.slice(n));return r?(e.p=Te[r[0].toLowerCase()],n+r[0].length):-1},Q:Z,s:b,S:F,u:m,U:v,V:M,w:h,W:T,x:function(e,t,n){return be(e,i,t,n)},X:function(e,t,n){return be(e,a,t,n)},y:C,Y:D,Z:x,"%":A};function Ae(e,t){return function(n){var r,u,c,i=[],a=-1,f=0,l=e.length;for(n instanceof Date||(n=new Date(+n));++a<l;)37===e.charCodeAt(a)&&(i.push(e.slice(f,a)),null!=(u=o[r=e.charAt(++a)])?r=e.charAt(++a):u="e"===r?" ":"0",(c=t[r])&&(r=c(n,u)),i.push(r),f=a+1);return i.push(e.slice(f,a)),i.join("")}}function Ze(e,n){return function(c){var i,o,a=u(1900);if(be(a,e,c+="",0)!=c.length)return null;if("Q"in a)return new Date(a.Q);if("p"in a&&(a.H=a.H%12+12*a.p),"V"in a){if(a.V<1||a.V>53)return null;"w"in a||(a.w=1),"Z"in a?(o=(i=r(u(a.y))).getUTCDay(),i=o>4||0===o?t.utcMonday.ceil(i):t.utcMonday(i),i=t.utcDay.offset(i,7*(a.V-1)),a.y=i.getUTCFullYear(),a.m=i.getUTCMonth(),a.d=i.getUTCDate()+(a.w+6)%7):(o=(i=n(u(a.y))).getDay(),i=o>4||0===o?t.timeMonday.ceil(i):t.timeMonday(i),i=t.timeDay.offset(i,7*(a.V-1)),a.y=i.getFullYear(),a.m=i.getMonth(),a.d=i.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?r(u(a.y)).getUTCDay():n(u(a.y)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,r(a)):n(a)}}function be(e,t,n,r){for(var u,c,i=0,a=t.length,f=n.length;i<a;){if(r>=f)return-1;if(37===(u=t.charCodeAt(i++))){if(u=t.charAt(i++),!(c=Le[u in o?t.charAt(i++):u])||(r=c(e,n,r))<0)return-1}else if(u!=n.charCodeAt(r++))return-1}return r}return Fe.x=Ae(i,Fe),Fe.X=Ae(a,Fe),Fe.c=Ae(c,Fe),He.x=Ae(i,He),He.X=Ae(a,He),He.c=Ae(c,He),{format:function(e){var t=Ae(e+="",Fe);return t.toString=function(){return e},t},parse:function(e){var t=Ze(e+="",n);return t.toString=function(){return e},t},utcFormat:function(e){var t=Ae(e+="",He);return t.toString=function(){return e},t},utcParse:function(e){var t=Ze(e,r);return t.toString=function(){return e},t}}}var i,o={"-":"",_:" ",0:"0"},a=/^\s*\d+/,f=/^%/,l=/[\\^$*+?|[\]().{}]/g;function s(e,t,n){var r=e<0?"-":"",u=(r?-e:e)+"",c=u.length;return r+(c<n?new Array(n-c+1).join(t)+u:u)}function g(e){return e.replace(l,"\\$&")}function y(e){return new RegExp("^(?:"+e.map(g).join("|")+")","i")}function d(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function h(e,t,n){var r=a.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function m(e,t,n){var r=a.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function v(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function M(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function T(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function D(e,t,n){var r=a.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function C(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function x(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function U(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function p(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function w(e,t,n){var r=a.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function S(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Y(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function F(e,t,n){var r=a.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function H(e,t,n){var r=a.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function L(e,t,n){var r=a.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function A(e,t,n){var r=f.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Z(e,t,n){var r=a.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function b(e,t,n){var r=a.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function W(e,t){return s(e.getDate(),t,2)}function V(e,t){return s(e.getHours(),t,2)}function j(e,t){return s(e.getHours()%12||12,t,2)}function P(e,n){return s(1+t.timeDay.count(t.timeYear(e),e),n,3)}function Q(e,t){return s(e.getMilliseconds(),t,3)}function I(e,t){return Q(e,t)+"000"}function J(e,t){return s(e.getMonth()+1,t,2)}function O(e,t){return s(e.getMinutes(),t,2)}function X(e,t){return s(e.getSeconds(),t,2)}function N(e){var t=e.getDay();return 0===t?7:t}function B(e,n){return s(t.timeSunday.count(t.timeYear(e),e),n,2)}function _(e,n){var r=e.getDay();return e=r>=4||0===r?t.timeThursday(e):t.timeThursday.ceil(e),s(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),n,2)}function $(e){return e.getDay()}function q(e,n){return s(t.timeMonday.count(t.timeYear(e),e),n,2)}function z(e,t){return s(e.getFullYear()%100,t,2)}function E(e,t){return s(e.getFullYear()%1e4,t,4)}function R(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+s(t/60|0,"0",2)+s(t%60,"0",2)}function k(e,t){return s(e.getUTCDate(),t,2)}function G(e,t){return s(e.getUTCHours(),t,2)}function K(e,t){return s(e.getUTCHours()%12||12,t,2)}function ee(e,n){return s(1+t.utcDay.count(t.utcYear(e),e),n,3)}function te(e,t){return s(e.getUTCMilliseconds(),t,3)}function ne(e,t){return te(e,t)+"000"}function re(e,t){return s(e.getUTCMonth()+1,t,2)}function ue(e,t){return s(e.getUTCMinutes(),t,2)}function ce(e,t){return s(e.getUTCSeconds(),t,2)}function ie(e){var t=e.getUTCDay();return 0===t?7:t}function oe(e,n){return s(t.utcSunday.count(t.utcYear(e),e),n,2)}function ae(e,n){var r=e.getUTCDay();return e=r>=4||0===r?t.utcThursday(e):t.utcThursday.ceil(e),s(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),n,2)}function fe(e){return e.getUTCDay()}function le(e,n){return s(t.utcMonday.count(t.utcYear(e),e),n,2)}function se(e,t){return s(e.getUTCFullYear()%100,t,2)}function ge(e,t){return s(e.getUTCFullYear()%1e4,t,4)}function ye(){return"+0000"}function de(){return"%"}function he(e){return+e}function me(e){return Math.floor(+e/1e3)}function ve(t){return i=c(t),e.timeFormat=i.format,e.timeParse=i.parse,e.utcFormat=i.utcFormat,e.utcParse=i.utcParse,i}ve({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Me=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var Te=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse("%Y-%m-%dT%H:%M:%S.%LZ");e.timeFormatDefaultLocale=ve,e.timeFormatLocale=c,e.isoFormat=Me,e.isoParse=Te,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "d3-time-format",
"version": "2.1.2",
"version": "2.1.3",
"description": "A JavaScript time formatter and parser inspired by strftime and strptime.",

@@ -19,5 +19,6 @@ "keywords": [

},
"main": "dist/d3-time-format.min.js",
"module": "index",
"jsnext:main": "index",
"main": "dist/d3-time-format.js",
"unpkg": "dist/d3-time-format.min.js",
"jsdelivr": "dist/d3-time-format.min.js",
"module": "src/index.js",
"repository": {

@@ -29,3 +30,3 @@ "type": "git",

"pretest": "rollup -c",
"test": "TZ=America/Los_Angeles tape 'test/**/*-test.js' && eslint index.js src",
"test": "TZ=America/Los_Angeles tape 'test/**/*-test.js' && eslint src",
"prepublishOnly": "rm -rf dist && yarn test",

@@ -32,0 +33,0 @@ "postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"

@@ -5,4 +5,4 @@ import {terser} from "rollup-plugin-terser";

const config = {
input: "index.js",
external: Object.keys(meta.dependencies || {}),
input: "src/index.js",
external: Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)),
output: {

@@ -15,3 +15,3 @@ file: `dist/${meta.name}.js`,

banner: `// ${meta.homepage} v${meta.version} Copyright ${(new Date).getFullYear()} ${meta.author.name}`,
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).map(key => ({[key]: "d3"})))
globals: Object.assign({}, ...Object.keys(meta.dependencies || {}).filter(key => /^d3-/.test(key)).map(key => ({[key]: "d3"})))
},

@@ -18,0 +18,0 @@ plugins: []

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