Socket
Socket
Sign inDemoInstall

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 0.4.0 to 1.0.0

2

build/d3-time-format.js

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

// https://d3js.org/d3-time-format/ Version 0.4.0. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-time-format/ Version 1.0.0. Copyright 2016 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/ Version 0.4.0. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-time-format/ Version 1.0.0. Copyright 2016 Mike Bostock.
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-time"],e):e(n.d3=n.d3||{},n.d3)}(this,function(n,e){"use strict";function t(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function r(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function u(n){return{y:n,m:0,d:1,H:0,M:0,S:0,L:0}}function o(n){function e(n,e){return function(t){var r,u,o,i=[],c=-1,a=0,f=n.length;for(t instanceof Date||(t=new Date(+t));++c<f;)37===n.charCodeAt(c)&&(i.push(n.slice(a,c)),null!=(u=cn[r=n.charAt(++c)])?r=n.charAt(++c):u="e"===r?" ":"0",(o=e[r])&&(r=o(t,u)),i.push(r),a=c+1);return i.push(n.slice(a,c)),i.join("")}}function o(n,e){return function(t){var o=u(1900),c=i(o,n,t+="",0);if(c!=t.length)return null;if("p"in o&&(o.H=o.H%12+12*o.p),"W"in o||"U"in o){"w"in o||(o.w="W"in o?1:0);var a="Z"in o?r(u(o.y)).getUTCDay():e(u(o.y)).getDay();o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(a+5)%7:o.w+7*o.U-(a+6)%7}return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,r(o)):e(o)}}function i(n,e,t,r){for(var u,o,i=0,c=e.length,a=t.length;c>i;){if(r>=a)return-1;if(u=e.charCodeAt(i++),37===u){if(u=e.charAt(i++),o=On[u in cn?e.charAt(i++):u],!o||(r=o(n,t,r))<0)return-1}else if(u!=t.charCodeAt(r++))return-1}return r}function c(n,e,t){var r=Un.exec(e.slice(t));return r?(n.p=Hn[r[0].toLowerCase()],t+r[0].length):-1}function V(n,e,t){var r=An.exec(e.slice(t));return r?(n.w=Fn[r[0].toLowerCase()],t+r[0].length):-1}function nn(n,e,t){var r=Yn.exec(e.slice(t));return r?(n.w=Ln[r[0].toLowerCase()],t+r[0].length):-1}function en(n,e,t){var r=Wn.exec(e.slice(t));return r?(n.m=jn[r[0].toLowerCase()],t+r[0].length):-1}function tn(n,e,t){var r=bn.exec(e.slice(t));return r?(n.m=Zn[r[0].toLowerCase()],t+r[0].length):-1}function rn(n,e,t){return i(n,Mn,e,t)}function un(n,e,t){return i(n,pn,e,t)}function on(n,e,t){return i(n,Sn,e,t)}function an(n){return Tn[n.getDay()]}function fn(n){return Cn[n.getDay()]}function ln(n){return wn[n.getMonth()]}function sn(n){return Dn[n.getMonth()]}function gn(n){return xn[+(n.getHours()>=12)]}function dn(n){return Tn[n.getUTCDay()]}function hn(n){return Cn[n.getUTCDay()]}function yn(n){return wn[n.getUTCMonth()]}function mn(n){return Dn[n.getUTCMonth()]}function vn(n){return xn[+(n.getUTCHours()>=12)]}var Mn=n.dateTime,pn=n.date,Sn=n.time,xn=n.periods,Cn=n.days,Tn=n.shortDays,Dn=n.months,wn=n.shortMonths,Un=a(xn),Hn=f(xn),Yn=a(Cn),Ln=f(Cn),An=a(Tn),Fn=f(Tn),bn=a(Dn),Zn=f(Dn),Wn=a(wn),jn=f(wn),Pn={a:an,A:fn,b:ln,B:sn,c:null,d:D,e:D,H:w,I:U,j:H,L:Y,m:L,M:A,p:gn,S:F,U:b,w:Z,W:W,x:null,X:null,y:j,Y:P,Z:J,"%":Q},Jn={a:dn,A:hn,b:yn,B:mn,c:null,d:O,e:O,H:X,I:I,j:N,L:B,m:_,M:$,p:vn,S:q,U:z,w:E,W:R,x:null,X:null,y:k,Y:G,Z:K,"%":Q},On={a:V,A:nn,b:en,B:tn,c:rn,d:v,e:v,H:p,I:p,j:M,L:C,m:m,M:S,p:c,S:x,U:s,w:l,W:g,x:un,X:on,y:h,Y:d,Z:y,"%":T};return Pn.x=e(pn,Pn),Pn.X=e(Sn,Pn),Pn.c=e(Mn,Pn),Jn.x=e(pn,Jn),Jn.X=e(Sn,Jn),Jn.c=e(Mn,Jn),{format:function(n){var t=e(n+="",Pn);return t.toString=function(){return n},t},parse:function(n){var e=o(n+="",t);return e.toString=function(){return n},e},utcFormat:function(n){var t=e(n+="",Jn);return t.toString=function(){return n},t},utcParse:function(n){var e=o(n,r);return e.toString=function(){return n},e}}}function i(n,e,t){var r=0>n?"-":"",u=(r?-n:n)+"",o=u.length;return r+(t>o?new Array(t-o+1).join(e)+u:u)}function c(n){return n.replace(ln,"\\$&")}function a(n){return new RegExp("^(?:"+n.map(c).join("|")+")","i")}function f(n){for(var e={},t=-1,r=n.length;++t<r;)e[n[t].toLowerCase()]=t;return e}function l(n,e,t){var r=an.exec(e.slice(t,t+1));return r?(n.w=+r[0],t+r[0].length):-1}function s(n,e,t){var r=an.exec(e.slice(t));return r?(n.U=+r[0],t+r[0].length):-1}function g(n,e,t){var r=an.exec(e.slice(t));return r?(n.W=+r[0],t+r[0].length):-1}function d(n,e,t){var r=an.exec(e.slice(t,t+4));return r?(n.y=+r[0],t+r[0].length):-1}function h(n,e,t){var r=an.exec(e.slice(t,t+2));return r?(n.y=+r[0]+(+r[0]>68?1900:2e3),t+r[0].length):-1}function y(n,e,t){var r=/^(Z)|([+-]\d\d)(?:\:?(\d\d))?/.exec(e.slice(t,t+6));return r?(n.Z=r[1]?0:-(r[2]+(r[3]||"00")),t+r[0].length):-1}function m(n,e,t){var r=an.exec(e.slice(t,t+2));return r?(n.m=r[0]-1,t+r[0].length):-1}function v(n,e,t){var r=an.exec(e.slice(t,t+2));return r?(n.d=+r[0],t+r[0].length):-1}function M(n,e,t){var r=an.exec(e.slice(t,t+3));return r?(n.m=0,n.d=+r[0],t+r[0].length):-1}function p(n,e,t){var r=an.exec(e.slice(t,t+2));return r?(n.H=+r[0],t+r[0].length):-1}function S(n,e,t){var r=an.exec(e.slice(t,t+2));return r?(n.M=+r[0],t+r[0].length):-1}function x(n,e,t){var r=an.exec(e.slice(t,t+2));return r?(n.S=+r[0],t+r[0].length):-1}function C(n,e,t){var r=an.exec(e.slice(t,t+3));return r?(n.L=+r[0],t+r[0].length):-1}function T(n,e,t){var r=fn.exec(e.slice(t,t+1));return r?t+r[0].length:-1}function D(n,e){return i(n.getDate(),e,2)}function w(n,e){return i(n.getHours(),e,2)}function U(n,e){return i(n.getHours()%12||12,e,2)}function H(n,t){return i(1+e.timeDay.count(e.timeYear(n),n),t,3)}function Y(n,e){return i(n.getMilliseconds(),e,3)}function L(n,e){return i(n.getMonth()+1,e,2)}function A(n,e){return i(n.getMinutes(),e,2)}function F(n,e){return i(n.getSeconds(),e,2)}function b(n,t){return i(e.timeSunday.count(e.timeYear(n),n),t,2)}function Z(n){return n.getDay()}function W(n,t){return i(e.timeMonday.count(e.timeYear(n),n),t,2)}function j(n,e){return i(n.getFullYear()%100,e,2)}function P(n,e){return i(n.getFullYear()%1e4,e,4)}function J(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+i(e/60|0,"0",2)+i(e%60,"0",2)}function O(n,e){return i(n.getUTCDate(),e,2)}function X(n,e){return i(n.getUTCHours(),e,2)}function I(n,e){return i(n.getUTCHours()%12||12,e,2)}function N(n,t){return i(1+e.utcDay.count(e.utcYear(n),n),t,3)}function B(n,e){return i(n.getUTCMilliseconds(),e,3)}function _(n,e){return i(n.getUTCMonth()+1,e,2)}function $(n,e){return i(n.getUTCMinutes(),e,2)}function q(n,e){return i(n.getUTCSeconds(),e,2)}function z(n,t){return i(e.utcSunday.count(e.utcYear(n),n),t,2)}function E(n){return n.getUTCDay()}function R(n,t){return i(e.utcMonday.count(e.utcYear(n),n),t,2)}function k(n,e){return i(n.getUTCFullYear()%100,e,2)}function G(n,e){return i(n.getUTCFullYear()%1e4,e,4)}function K(){return"+0000"}function Q(){return"%"}function V(n){return n.toISOString()}function nn(n){var e=new Date(n);return isNaN(e)?null:e}var en=o({dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]}),tn=en.format,rn=en.parse,un=en.utcFormat,on=en.utcParse,cn={"-":"",_:" ",0:"0"},an=/^\s*\d+/,fn=/^%/,ln=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sn="%Y-%m-%dT%H:%M:%S.%LZ",gn=Date.prototype.toISOString?V:un(sn),dn=+new Date("2000-01-01T00:00:00.000Z")?nn:on(sn);n.timeFormatLocale=o,n.timeFormat=tn,n.timeParse=rn,n.utcFormat=un,n.utcParse=on,n.isoFormat=gn,n.isoParse=dn,Object.defineProperty(n,"__esModule",{value:!0})});
{
"name": "d3-time-format",
"version": "0.4.0",
"version": "1.0.0",
"description": "A JavaScript time formatter and parser inspired by strftime and strptime.",
"keywords": [
"d3",
"d3-module",
"time",

@@ -28,6 +29,6 @@ "format",

"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-time-format.js -c -m -o build/d3-time-format.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-time-format.js ../d3.github.com/d3-time-format.v0.4.js && cp build/d3-time-format.min.js ../d3.github.com/d3-time-format.v0.4.min.js && cd ../d3.github.com && git add d3-time-format.v0.4.js d3-time-format.v0.4.min.js && git commit -m \"d3-time-format ${VERSION}\" && git push && cd - && zip -j build/d3-time-format.zip -- LICENSE README.md build/d3-time-format.js build/d3-time-format.min.js"
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-time-format.js ../d3.github.com/d3-time-format.v1.js && cp build/d3-time-format.min.js ../d3.github.com/d3-time-format.v1.min.js && cd ../d3.github.com && git add d3-time-format.v1.js d3-time-format.v1.min.js && git commit -m \"d3-time-format ${VERSION}\" && git push && cd - && zip -j build/d3-time-format.zip -- LICENSE README.md build/d3-time-format.js build/d3-time-format.min.js"
},
"dependencies": {
"d3-time": "~0.3.0"
"d3-time": "1"
},

@@ -37,3 +38,3 @@ "devDependencies": {

"package-preamble": "0.0",
"rollup": "0.27",
"rollup": "0.31",
"tape": "4",

@@ -40,0 +41,0 @@ "uglify-js": "2"

@@ -44,7 +44,7 @@ # d3-time-format

If you use NPM, `npm install d3-time-format`. Otherwise, download the [latest release](https://github.com/d3/d3-time-format/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-time-format.v0.4.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
If you use NPM, `npm install d3-time-format`. Otherwise, download the [latest release](https://github.com/d3/d3-time-format/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-time-format.v1.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported:
```html
<script src="https://d3js.org/d3-time.v0.3.min.js"></script>
<script src="https://d3js.org/d3-time-format.v0.4.min.js"></script>
<script src="https://d3js.org/d3-time.v1.min.js"></script>
<script src="https://d3js.org/d3-time-format.v1.min.js"></script>
<script>

@@ -63,15 +63,15 @@

An alias for [*locale*.format](#locale_format) on the [U.S. English locale](#timeFormatEnUs). See the other [locales](#locales).
An alias for [*locale*.format](#locale_format) on the U.S. English locale. See [d3.timeFormatLocale](#timeFormatLocale) to defined a new locale.
<a name="timeParse" href="#timeParse">#</a> d3.<b>timeParse</b>(<i>specifier</i>)
An alias for [*locale*.parse](#locale_parse) on the [U.S. English locale](#timeFormatEnUs). See the other [locales](#locales).
An alias for [*locale*.parse](#locale_parse) on the U.S. English locale. See [d3.timeFormatLocale](#timeFormatLocale) to defined a new locale.
<a name="utcFormat" href="#utcFormat">#</a> d3.<b>utcFormat</b>(<i>specifier</i>)
An alias for [*locale*.utcFormat](#locale_utcFormat) on the [U.S. English locale](#localeEnUs). See the other [locales](#locales).
An alias for [*locale*.utcFormat](#locale_utcFormat) on the U.S. English locale. See [d3.timeFormatLocale](#timeFormatLocale) to defined a new locale.
<a name="utcParse" href="#utcParse">#</a> d3.<b>utcParse</b>(<i>specifier</i>)
An alias for [*locale*.utcParse](#locale_utcParse) on the [U.S. English locale](#localeEnUs). See the other [locales](#locales).
An alias for [*locale*.utcParse](#locale_utcParse) on the U.S. English locale. See [d3.timeFormatLocale](#timeFormatLocale) to defined a new locale.

@@ -170,89 +170,1 @@ <a name="isoFormat" href="#isoFormat">#</a> d3.<b>isoFormat</b>

* `shortMonths` - the abbreviated names of the months (starting with January).
<a name="timeFormatCaEs" href="#timeFormatCaEs">#</a> d3.<b>timeFormatCaEs</b>
[Catalan (Spain)](https://github.com/d3/d3-time-format/tree/master/src/locale/ca-ES.js)
<a name="timeFormatDeCh" href="#timeFormatDeCh">#</a> d3.<b>timeFormatDeCh</b>
[German (Switzerland)](https://github.com/d3/d3-time-format/tree/master/src/locale/de-CH.js)
<a name="timeFormatDeDe" href="#timeFormatDeDe">#</a> d3.<b>timeFormatDeDe</b>
[German (Germany)](https://github.com/d3/d3-time-format/tree/master/src/locale/de-DE.js)
<a name="timeFormatEnCa" href="#timeFormatEnCa">#</a> d3.<b>timeFormatEnCa</b>
[English (Canada)](https://github.com/d3/d3-time-format/tree/master/src/locale/en-CA.js)
<a name="timeFormatEnGb" href="#timeFormatEnGb">#</a> d3.<b>timeFormatEnGb</b>
[English (United Kingdom)](https://github.com/d3/d3-time-format/tree/master/src/locale/en-GB.js)
<a name="timeFormatEnUs" href="#timeFormatEnUs">#</a> d3.<b>timeFormatEnUs</b>
[English (United States)](https://github.com/d3/d3-time-format/tree/master/src/locale/en-US.js)
<a name="timeFormatEsEs" href="#timeFormatEsEs">#</a> d3.<b>timeFormatEsEs</b>
[Spanish (Spain)](https://github.com/d3/d3-time-format/tree/master/src/locale/es-ES.js)
<a name="timeFormatFiFi" href="#timeFormatFiFi">#</a> d3.<b>timeFormatFiFi</b>
[Finnish (Finland)](https://github.com/d3/d3-time-format/tree/master/src/locale/fi-FI.js)
<a name="timeFormatFrCa" href="#timeFormatFrCa">#</a> d3.<b>timeFormatFrCa</b>
[French (Canada)](https://github.com/d3/d3-time-format/tree/master/src/locale/fr-CA.js)
<a name="timeFormatFrFr" href="#timeFormatFrFr">#</a> d3.<b>timeFormatFrFr</b>
[French (France)](https://github.com/d3/d3-time-format/tree/master/src/locale/fr-FR.js)
<a name="timeFormatHeIl" href="#timeFormatHeIl">#</a> d3.<b>timeFormatHeIl</b>
[Hebrew (Israel)](https://github.com/d3/d3-time-format/tree/master/src/locale/he-IL.js)
<a name="timeFormatHuHu" href="#timeFormatHuHu">#</a> d3.<b>timeFormatHuHu</b>
[Hungarian (Hungary)](https://github.com/d3/d3-time-format/tree/master/src/locale/hu-HU.js)
<a name="timeFormatItIt" href="#timeFormatItIt">#</a> d3.<b>timeFormatItIt</b>
[Italian (Italy)](https://github.com/d3/d3-time-format/tree/master/src/locale/it-IT.js)
<a name="timeFormatJaJp" href="#timeFormatJaJp">#</a> d3.<b>timeFormatJaJp</b>
[Japanese (Japan)](https://github.com/d3/d3-time-format/tree/master/src/locale/ja-JP.js)
<a name="timeFormatKoKr" href="#timeFormatKoKr">#</a> d3.<b>timeFormatKoKr</b>
[Korean (South Korea)](https://github.com/d3/d3-time-format/tree/master/src/locale/ko-KR.js)
<a name="timeFormatMkMk" href="#timeFormatMkMk">#</a> d3.<b>timeFormatMkMk</b>
[Macedonian (Macedonia)](https://github.com/d3/d3-time-format/tree/master/src/locale/mk-MK.js)
<a name="timeFormatNlNl" href="#timeFormatNlNl">#</a> d3.<b>timeFormatNlNl</b>
[Dutch (Netherlands)](https://github.com/d3/d3-time-format/tree/master/src/locale/nl-NL.js)
<a name="timeFormatPlPl" href="#timeFormatPlPl">#</a> d3.<b>timeFormatPlPl</b>
[Polish (Poland)](https://github.com/d3/d3-time-format/tree/master/src/locale/pl-PL.js)
<a name="timeFormatPtBr" href="#timeFormatPtBr">#</a> d3.<b>timeFormatPtBr</b>
[Portuguese (Brazil)](https://github.com/d3/d3-time-format/tree/master/src/locale/pt-BR.js)
<a name="timeFormatRuRu" href="#timeFormatRuRu">#</a> d3.<b>timeFormatRuRu</b>
[Russian (Russia)](https://github.com/d3/d3-time-format/tree/master/src/locale/ru-RU.js)
<a name="timeFormatSvSe" href="#timeFormatSvSe">#</a> d3.<b>timeFormatSvSe</b>
[Swedish (Sweden)](https://github.com/d3/d3-time-format/tree/master/src/locale/sv-SE.js)
<a name="timeFormatZhCn" href="#timeFormatZhCn">#</a> d3.<b>timeFormatZhCn</b>
[Chinese (China)](https://github.com/d3/d3-time-format/tree/master/src/locale/zh-CN.js)

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