New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

d8

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d8 - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

78

d8.js

@@ -102,3 +102,3 @@

function clone() { return new Date( this.valueOf() ); }
function clone() { return new Date( this.getTime() ); }

@@ -123,3 +123,3 @@ function dayOfYear() {

function setWeek( v ) { this.setMonth( 0 ); this.setDate( 1 ); return ( this.adjust( Date.DAY, v * 7 ) ).valueOf(); }
function setWeek( v ) { this.setMonth( 0 ); this.setDate( 1 ); return ( this.adjust( Date.DAY, v * 7 ) ).getTime(); }

@@ -266,4 +266,4 @@ function timezone() {

filter, formats = copy( {
ISO_8601 : 'Y-m-d<T>H:i:sP', ISO_8601_SHORT : 'Y-m-d',
RFC_850 : 'l, d-M-y H:i:s T', RFC_2822 : 'D, d M Y H:i:s O',
ISO_8601 : 'Y-m-d<T>H:i:s.u<Z>', ISO_8601_SHORT : 'Y-m-d',
RFC_850 : 'l, d-M-y H:i:s T', RFC_2822 : 'D, d M Y H:i:s O',
sortable : 'Y-m-d H:i:sO'

@@ -282,46 +282,46 @@ }, LOCALE.formats ),

// day
d : function( d ) { return pad( d.getDate(), 2 ); }, // Day of the month, 2 digits with leading zeros
D : function( d ) { return LOCALE.days[d.getDay()].substring( 0, 3 ); }, // A textual representation of a day, three letters
j : function( d ) { return d.getDate(); }, // Day of the month without leading zeros
l : function( d ) { return LOCALE.days[d.getDay()]; }, // A full textual representation of the day of the week
N : function( d ) { return d.ISODay(); }, // ISO-8601 numeric representation of the day of the week
S : function( d ) { return LOCALE.getOrdinal( d.getDate() ); }, // English ordinal suffix for the day of the month, 2 characters
w : function( d ) { return d.getDay(); }, // Numeric representation of the day of the week
z : function( d ) { return d.dayOfYear(); }, // The day of the year (starting from 0)
d : function( d ) { return pad( d.getDate(), 2 ); }, // Day of the month, 2 digits with leading zeros
D : function( d ) { return LOCALE.days[d.getDay()].substring( 0, 3 ); }, // A textual representation of a day, three letters
j : function( d ) { return d.getDate(); }, // Day of the month without leading zeros
l : function( d ) { return LOCALE.days[d.getDay()]; }, // A full textual representation of the day of the week
N : function( d ) { return d.ISODay(); }, // ISO-8601 numeric representation of the day of the week
S : function( d ) { return LOCALE.getOrdinal( d.getDate() ); }, // English ordinal suffix for the day of the month, 2 characters
w : function( d ) { return d.getDay(); }, // Numeric representation of the day of the week
z : function( d ) { return d.dayOfYear(); }, // The day of the year (starting from 0)
// week
W : function( d ) { return d.ISOWeek(); }, // ISO-8601 week number of year, weeks starting on Monday
W : function( d ) { return d.ISOWeek(); }, // ISO-8601 week number of year, weeks starting on Monday
// month
F : function( d ) { return LOCALE.months[d.getMonth()]; }, // A full textual representation of a month
m : function( d ) { return pad( ( d.getMonth() + 1 ), 2 ); }, // Numeric representation of a month, with leading zeros
M : function( d ) { return LOCALE.months[d.getMonth()].substring( 0, 3 ); }, // A short textual representation of a month, three letters
n : function( d ) { return d.getMonth() + 1; }, // Numeric representation of a month, without leading zeros
F : function( d ) { return LOCALE.months[d.getMonth()]; }, // A full textual representation of a month
m : function( d ) { return pad( ( d.getMonth() + 1 ), 2 ); }, // Numeric representation of a month, with leading zeros
M : function( d ) { return LOCALE.months[d.getMonth()].substring( 0, 3 ); }, // A short textual representation of a month, three letters
n : function( d ) { return d.getMonth() + 1; }, // Numeric representation of a month, without leading zeros
t : function( d ) { LOCALE.setLeapYear( d ); return LOCALE.day_count[d.getMonth()]; }, // Number of days in the given month
// year
L : function( d ) { return ( d.isLeapYear() ) ? 1 : 0; }, // Whether it's a leap year
o : function( d ) { // ISO-8601 year number. This has the same value as Y, except that if the ISO
var m = d.getMonth(), w = d.ISOWeek(); // week number (W) belongs to the previous or next year, that year is used instead.
L : function( d ) { return ( d.isLeapYear() ) ? 1 : 0; }, // Whether it's a leap year
o : function( d ) { // ISO-8601 year number. This has the same value as Y, except that if the ISO
var m = d.getMonth(), w = d.ISOWeek(); // week number (W) belongs to the previous or next year, that year is used instead.
return ( d.getFullYear() + ( w == 1 && m > 0 ? 1 : ( w >= 52 && m < 11 ? -1 : 0 ) ) );
},
Y : function( d ) { return d.getFullYear(); }, // A full numeric representation of a year, 4 digits
y : function( d ) { return String( d.getFullYear() ).substring( 2, 4 ); }, // A two digit representation of a year
Y : function( d ) { return d.getFullYear(); }, // A full numeric representation of a year, 4 digits
y : function( d ) { return String( d.getFullYear() ).substring( 2, 4 ); }, // A two digit representation of a year
// time
a : function( d ) { return _lc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Lowercase Ante meridiem and Post meridiem
A : function( d ) { return _uc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Uppercase Ante meridiem and Post meridiem
g : function( d ) { return d.getHours() % 12 || 12; }, // 12-hour format of an hour without leading zeros
G : function( d ) { return d.getHours(); }, // 24-hour format of an hour without leading zeros
h : function( d ) { return pad( filter.g( d ), 2 ); }, // 12-hour format of an hour with leading zeros
H : function( d ) { return pad( filter.G( d ), 2 ); }, // 24-hour format of an hour with leading zeros
i : function( d ) { return pad( d.getMinutes(), 2 ); }, // Minutes with leading zeros
s : function( d ) { return pad( d.getSeconds(), 2 ); }, // Seconds, with leading zeros
u : function( d ) { return pad( d.getMilliseconds(), 3 ); }, // Milliseconds
a : function( d ) { return _lc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Lowercase Ante meridiem and Post meridiem
A : function( d ) { return _uc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Uppercase Ante meridiem and Post meridiem
g : function( d ) { return d.getHours() % 12 || 12; }, // 12-hour format of an hour without leading zeros
G : function( d ) { return d.getHours(); }, // 24-hour format of an hour without leading zeros
h : function( d ) { return pad( filter.g( d ), 2 ); }, // 12-hour format of an hour with leading zeros
H : function( d ) { return pad( filter.G( d ), 2 ); }, // 24-hour format of an hour with leading zeros
i : function( d ) { return pad( d.getMinutes(), 2 ); }, // Minutes with leading zeros
s : function( d ) { return pad( d.getSeconds(), 2 ); }, // Seconds, with leading zeros
u : function( d ) { return pad( d.getMilliseconds(), 3 ); }, // Milliseconds
// timezone
O : function( d ) { return d.GMTOffset(); }, // Difference to Greenwich time (GMT) in hours
P : function( d ) { return d.GMTOffset( T ); }, // Difference to Greenwich time (GMT) with colon between hours and minutes
T : function( d ) { return d[TIMEZONE](); }, // Timezone abbreviation
Z : function( d ) { return d.getTimezoneOffset() * -60; }, // Timezone offset in seconds. The offset for timezones west of UTC
// is always negative, and for those east of UTC is always positive.
O : function( d ) { return d.GMTOffset(); }, // Difference to Greenwich time (GMT) in hours
P : function( d ) { return d.GMTOffset( T ); }, // Difference to Greenwich time (GMT) with colon between hours and minutes
T : function( d ) { return d[TIMEZONE](); }, // Timezone abbreviation
Z : function( d ) { return d.getTimezoneOffset() * -60; }, // Timezone offset in seconds. The offset for timezones west of UTC
// is always negative, and for those east of UTC is always positive.
// full date/time
c : function( d ) { return format( d, formats.ISO_8601 ); }, // ISO 8601 date
r : function( d ) { return format( d, formats.RFC_2822 ); }, // RFC 2822 formatted date
U : function( d ) { return d.getTime(); } // Seconds since the Unix Epoch January 1 1970 00:00:00 GMT
c : function( d ) { return format( d, formats.ISO_8601 ); }, // ISO 8601 date
r : function( d ) { return format( d, formats.RFC_2822 ); }, // RFC 2822 formatted date
U : function( d ) { return d.getTime(); } // Seconds since the Unix Epoch January 1 1970 00:00:00 GMT
};

@@ -328,0 +328,0 @@

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

!function(){function a(a,b){var c=a.indexOf(b);return c==-1?Z:c}function b(a){return a.toLowerCase()}function c(a){return a.substring(0,3)}function d(a){return a.toUpperCase()}function e(a,b){return a.reduce(function(a,c,d){return a[b[d]]=c,a},{})}function f(a,b,c){return a<=b&&a>=c}function g(a,b,c){for(var d in b)!j(b,d)||j(a,d)&&c!==_||(a[d]=b[d]);return a}function h(a,b,c){return c||(c=a),Object.keys(a).forEach(function(d,e){b.call(c,a[d],d,e,a)}),a}function i(a,b){return!(b in a)}function j(a,b){return $.hasOwnProperty.call(a,b)}function k(a,b,c){var d=-1,e=a.toString(c||10);b-=e.length;while(++d<b)e="0"+e;return e}function m(a,b){return a.reduce(function(a,c){return!(b in c)||a.push(c[b]),a},[])}function n(a){return a}function o(a,b){return a+b}function p(a,b,c,d){d[b]={configurable:X,enumerable:X,value:a,writeable:X}}function q(a,c){return(a=Number(a))<12&&b(c.ampm)==b(Y.PM)?a+=12:a}function r(a,b){this.adjust(b,a)}function s(a){return Math.floor((a-a.ISOFirstMondayOfYear())/bc)}function t(a){var b=a.indexOf("-")==0?X:_,c=a.match(/[\+-]?([0-9]{2}):?([0-9]{2})/),d=(Number(c[1])+c[2]/60)*3600;return b?d:-d}function u(a){return Math.floor(Math.abs(s(a)/7))}function v(a,b){return isNaN(b)?Number(a)-1:b==a?0:Number(b)}function w(a){var b=this.getTimezoneOffset();return[b>0?"-":"+",k(Math.floor(Math.abs(b)/60),2),a?":":"",k(Math.abs(b%60),2)].join("")}function x(){return this.getDay()||7}function y(){return Math.ceil(((new Date(this.getFullYear()+1,0,1)).ISOFirstMondayOfYear()-this.ISOFirstMondayOfYear())/bc)}function z(){var a=this.getFullYear();return new Date(a,0,bb[(new Date(a,0,1)).getDay()])}function A(){var a,b=this.getFullYear();return this>=(new Date(b+1,0,1)).ISOFirstMondayOfYear()?1:(a=Math.floor((this.dayOfYear()-this.ISODay()+10)/7),a==0?(new Date(b-1,0,1)).ISOWeeksInYear()-u(this):a)}function B(){return Math.round(((new Date(this.getFullYear()+1,0,1)).ISOFirstMondayOfYear()-this.ISOFirstMondayOfYear())/bd)}function C(a,b){if($.toString.call(a)=="[object Object]")return h(a,r,this),this;var c,d=bD[a.toLowerCase()],e;return!d||b===0?this:(Y.setLeapYear(this),d==bD.month&&(c=this.getDate(),c<28||this.setDate(Math.min(c,this.firstOfTheMonth().adjust(Date.MONTH,b).lastOfTheMonth()).getDate())),d==bD.week&&(e=this.getDay()),this[d[1]](this[d[0]]()+b),!e||this.setDate(this.getDate()+e),this)}function D(a,b){return this>=a&&this<=b}function E(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}function F(){return new Date(this.valueOf())}function G(){return Y.setLeapYear(this),Y.day_count.slice(0,this.getMonth()).reduce(o,0)+this.getDate()-1}function H(){return new Date(this.getFullYear(),this.getMonth(),1)}function I(){return Math.floor(this.dayOfYear()/7)}function J(){return(new Date(this.getFullYear(),0,1)).getTimezoneOffset()!=this.getTimezoneOffset()}function K(){return Y.isLeapYear(this.getFullYear())}function L(){var a=this.getMonth();return Y.setLeapYear(this),new Date(this.getFullYear(),a,Y.day_count[a])}function M(a){return this.setMonth(0),this.setDate(1),this.adjust(Date.DAY,a*7).valueOf()}function N(){var a=this.toString().split(" ");return a.splice(4,a.length).join(" ").replace(bN,"$1").replace(bO,"")}function O(a){if(bw[a])return bw[a];var b=["var out=[];"],c,d=a.replace(bH,bu).replace(bG,bv).split(bM),e=-1,f=d.length;while(++e<f){c=d[e];if(c==bt){b.push('out.push( "'+d[++e]+'" )'),++e;continue}b.push(P(c))}return b.push('return out.join( "" );'),bw[a]=new Function("filter","date",b.join("\n"))}function P(a){return a.replace(bI,function(a,b,c,d){return'out.push( "'+b+'", filter.'+c+'( date ), "'+d+'" );'})}function Q(a){return O(a)(bA,this)}function R(a){if(bx[a])return bx[a];var b={},c=[],d=-1,f=a.replace(bH,bu).replace(bG,bv).split(bM),h=f.length,i,j=[];while(++d<h){i=f[d];if(i==bt){j.push(f[++d]),++d;continue}i.replace(bI,function(a,d,f,h){var i,k,l;if(!(l=bE[f]))return;l.k&&(c.push(l.k),l.fn&&(b[l.k]=l.fn)),l.combo&&(k=m(l.combo,"k"),i=e(m(l.combo,"fn"),k),c.push.apply(c,k),g(b,i,_)),l.re&&j.push(d,l.re,h)})}return bx[a]=S.bind(Z,new RegExp(j.join("")),c,b)}function S(a,b,c,d){var f=new Date,g=d.match(a),i=e(g.slice(1),b);return h(i,function(a,b){c[b]&&(i[b]=c[b](a,i))}),isNaN(i[bq])?(U(f,i[bk],i[bm],i[bo],i[bl]),T(f,i),V(f,i[bp])):f.setTime(i[bq]),f}function T(a,b){var c,d,e,g=-1;if(bz.every(i.bind(Z,b)))return;isNaN(b[bs])&&(b[bs]=a.getFullYear());if(isNaN(b[bn])){d=Y.isLeapYear(b[bs])?1:0,e=Y.ordinal_day_count[d],l=e.length,b[bn]=0,b[br]&&!b[bj]&&(c=b[bi],c=isNaN(c)?0:c?c:7,b[bj]=b[br]*7-(4-c));if(!isNaN(b[bj])){b[bj]>e[e.length-1]&&(b[bj]-=e[e.length-1],++b[bs]);while(++g<l)if(f(b[bj],e[g],e[g+1])){b[bn]=g,b[bh]=e[g]==0?b[bj]:b[bj]-e[g];break}}}isNaN(b[bh])&&(b[bh]=1),a.setYear(b[bs]),a.setMonth(b[bn]),a.setDate(b[bh])}function U(a,b,c,d,e){a.setHours(b||0),a.setMinutes(c||0),a.setSeconds(d||0),a.setMilliseconds(e||0)}function V(a,b){if(!f(b,-43200,50400))return;a.adjust(Date[bo],-a.getTimezoneOffset()*60-b)}function W(a,b){return R(b)(a)}var X=!1,Y=Date.locale,Z=null,$=Object.prototype,_=!0,ba,bb=[9,1,0,-1,-2,4,3],bc=864e5,bd=6048e5,be=Y.days.map(c),bf=Y.months.map(c),bg="ampm",bh="day",bi="dayweek",bj="dayyear",bk="hour",bl="ms",bm="minute",bn="month",bo="second",bp="timezone",bq="unix",br="week",bs="year",bt="NOREPLACE",bu="<"+bt+"<",bv=">END"+bt+">",bw={},bx={},by,bz=[bh,bi,bj,bn,br,bs],bA,bB=g({ISO_8601:"Y-m-d<T>H:i:sP",ISO_8601_SHORT:"Y-m-d",RFC_850:"l, d-M-y H:i:s T",RFC_2822:"D, d M Y H:i:s O",sortable:"Y-m-d H:i:sO"},Y.formats),bC,bD={day:["getDate","setDate"],hr:["getHours","setHours"],min:["getMinutes","setMinutes"],month:["getMonth","setMonth"],ms:["getMilliseconds","setMilliseconds"],sec:["getSeconds","setSeconds"],week:["getWeek","setWeek"],year:["getFullYear","setFullYear"]},bE,bF="(am|pm)",bG=/>/g,bH=/</g,bI,bJ="([0-9]{1,2})",bK="([0-9]{2})",bL="([0-9]{4})",bM=/[<>]/,bN=/[^\(]*\(([^\)]+)\)/g,bO=/[^A-Z]+/g;bB.atom=bB.ISO_8601,bB.cookie=bB.RFC_850,bB.rss=bB.RFC_2822,bA={d:function(a){return k(a.getDate(),2)},D:function(a){return Y.days[a.getDay()].substring(0,3)},j:function(a){return a.getDate()},l:function(a){return Y.days[a.getDay()]},N:function(a){return a.ISODay()},S:function(a){return Y.getOrdinal(a.getDate())},w:function(a){return a.getDay()},z:function(a){return a.dayOfYear()},W:function(a){return a.ISOWeek()},F:function(a){return Y.months[a.getMonth()]},m:function(a){return k(a.getMonth()+1,2)},M:function(a){return Y.months[a.getMonth()].substring(0,3)},n:function(a){return a.getMonth()+1},t:function(a){return Y.setLeapYear(a),Y.day_count[a.getMonth()]},L:function(a){return a.isLeapYear()?1:0},o:function(a){var b=a.getMonth(),c=a.ISOWeek();return a.getFullYear()+(c==1&&b>0?1:c>=52&&b<11?-1:0)},Y:function(a){return a.getFullYear()},y:function(a){return String(a.getFullYear()).substring(2,4)},a:function(a){return b(a.getHours()<12?Y.AM:Y.PM)},A:function(a){return d(a.getHours()<12?Y.AM:Y.PM)},g:function(a){return a.getHours()%12||12},G:function(a){return a.getHours()},h:function(a){return k(bA.g(a),2)},H:function(a){return k(bA.G(a),2)},i:function(a){return k(a.getMinutes(),2)},s:function(a){return k(a.getSeconds(),2)},u:function(a){return k(a.getMilliseconds(),3)},O:function(a){return a.GMTOffset()},P:function(a){return a.GMTOffset(_)},T:function(a){return a[bp]()},Z:function(a){return a.getTimezoneOffset()*-60},c:function(a){return Q(a,bB.ISO_8601)},r:function(a){return Q(a,bB.RFC_2822)},U:function(a){return a.getTime()}},by=Object.keys(bA).sort().join(""),bI=new RegExp("([^"+by+"]*)(["+by+"])([^"+by+"]*)","g"),bE={d:{k:bh,fn:Number,re:bK},D:{k:bi,fn:a.bind(Z,be),re:"("+be.join("|")+")"},j:{k:bh,fn:Number,re:bJ},l:{k:bi,fn:a.bind(Z,Y.days),re:"("+Y.days.join("|")+")"},N:{k:bi,fn:v.bind(Z,7),re:"([1-7])"},S:{re:"(?:"+Y.ordinal.join("|")+")"},w:{k:bi,fn:Number,re:"([0-6])"},z:{k:bj,fn:Number,re:"([0-9]{1,3})"},W:{k:br,fn:Number,re:bK},F:{k:bn,fn:a.bind(Z,Y.months),re:"("+Y.months.join("|")+")"},m:{k:bn,fn:v,re:bK},M:{k:bn,fn:a.bind(Z,bf),re:"("+bf.join("|")+")"},n:{k:bn,fn:v,re:bJ},t:{re:"[0-9]{2}"},L:{re:"(?:0|1)"},o:{k:bs,fn:Number,re:bL},Y:{k:bs,fn:Number,re:bL},y:{k:bs,fn:function(a){return a=Number(a),a+=a<30?2e3:1900},re:bK},a:{k:bg,fn:n,re:bF},A:{k:bg,fn:b,re:d(bF)},g:{k:bk,fn:q,re:bJ},G:{k:bk,fn:Number,re:bJ},h:{k:bk,fn:q,re:bK},H:{k:bk,fn:Number,re:bK},i:{k:bm,fn:Number,re:bK},s:{k:bo,fn:Number,re:bK},u:{k:bl,fn:Number,re:"([0-9]{1,})"},O:{k:bp,fn:t,re:"([\\+-][0-9]{4})"},P:{k:bp,fn:t,re:"([\\+-][0-9]{2}:[0-9]{2})"},T:{re:"[A-Z]{1,4}"},Z:{k:bp,fn:Number,re:"([\\+-]?[0-9]{5})"},U:{k:bq,fn:Number,re:"(-?[0-9]{1,})"}},bE.c={combo:[bE.Y,bE.m,bE.d,bE.H,bE.i,bE.s,bE.P],re:[bE.Y.re,"-",bE.m.re,"-",bE.d.re,"T",bE.H.re,":",bE.i.re,":",bE.s.re,bE.P.re].join("")},bE.r={combo:[bE.D,bE.d,bE.M,bE.Y,bE.H,bE.i,bE.s,bE.O],re:[bE.D.re,", ",bE.d.re," ",bE.M.re," ",bE.Y.re," ",bE.H.re,":",bE.i.re,":",bE.s.re," ",bE.O.re].join("")},Object.defineProperties(Date.prototype,h({GMTOffset:w,ISODay:x,ISODaysInYear:y,ISOFirstMondayOfYear:z,ISOWeek:A,ISOWeeksInYear:B,adjust:C,between:D,clearTime:E,clone:F,dayOfYear:G,firstOfTheMonth:H,format:Q,getWeek:I,isDST:J,isLeapYear:K,lastOfTheMonth:L,setWeek:M,timezone:N},p)),Object.defineProperties(Date,h({DAY:bh,HOUR:"hr",MINUTE:bm.substring(0,3),MILLISECOND:bl,MONTH:bn,SECOND:bo.substring(0,3),WEEK:br,YEAR:bs,MS_DAY:bc,MS_WEEK:bd,MS_MONTH:2592e6,MS_YEAR:31536e6,filters:bA,formats:bB,parsers:bE,getOrdinal:Y.getOrdinal,isLeapYear:Y.isLeapYear,setLeapYear:Y.setLeapYear,toDate:W},p))}()
!function(){function a(a,b){var c=a.indexOf(b);return c==-1?Z:c}function b(a){return a.toLowerCase()}function c(a){return a.substring(0,3)}function d(a){return a.toUpperCase()}function e(a,b){return a.reduce(function(a,c,d){return a[b[d]]=c,a},{})}function f(a,b,c){return a<=b&&a>=c}function g(a,b,c){for(var d in b)!j(b,d)||j(a,d)&&c!==_||(a[d]=b[d]);return a}function h(a,b,c){return c||(c=a),Object.keys(a).forEach(function(d,e){b.call(c,a[d],d,e,a)}),a}function i(a,b){return!(b in a)}function j(a,b){return $.hasOwnProperty.call(a,b)}function k(a,b,c){var d=-1,e=a.toString(c||10);b-=e.length;while(++d<b)e="0"+e;return e}function m(a,b){return a.reduce(function(a,c){return!(b in c)||a.push(c[b]),a},[])}function n(a){return a}function o(a,b){return a+b}function p(a,b,c,d){d[b]={configurable:X,enumerable:X,value:a,writeable:X}}function q(a,c){return(a=Number(a))<12&&b(c.ampm)==b(Y.PM)?a+=12:a}function r(a,b){this.adjust(b,a)}function s(a){return Math.floor((a-a.ISOFirstMondayOfYear())/bc)}function t(a){var b=a.indexOf("-")==0?X:_,c=a.match(/[\+-]?([0-9]{2}):?([0-9]{2})/),d=(Number(c[1])+c[2]/60)*3600;return b?d:-d}function u(a){return Math.floor(Math.abs(s(a)/7))}function v(a,b){return isNaN(b)?Number(a)-1:b==a?0:Number(b)}function w(a){var b=this.getTimezoneOffset();return[b>0?"-":"+",k(Math.floor(Math.abs(b)/60),2),a?":":"",k(Math.abs(b%60),2)].join("")}function x(){return this.getDay()||7}function y(){return Math.ceil(((new Date(this.getFullYear()+1,0,1)).ISOFirstMondayOfYear()-this.ISOFirstMondayOfYear())/bc)}function z(){var a=this.getFullYear();return new Date(a,0,bb[(new Date(a,0,1)).getDay()])}function A(){var a,b=this.getFullYear();return this>=(new Date(b+1,0,1)).ISOFirstMondayOfYear()?1:(a=Math.floor((this.dayOfYear()-this.ISODay()+10)/7),a==0?(new Date(b-1,0,1)).ISOWeeksInYear()-u(this):a)}function B(){return Math.round(((new Date(this.getFullYear()+1,0,1)).ISOFirstMondayOfYear()-this.ISOFirstMondayOfYear())/bd)}function C(a,b){if($.toString.call(a)=="[object Object]")return h(a,r,this),this;var c,d=bD[a.toLowerCase()],e;return!d||b===0?this:(Y.setLeapYear(this),d==bD.month&&(c=this.getDate(),c<28||this.setDate(Math.min(c,this.firstOfTheMonth().adjust(Date.MONTH,b).lastOfTheMonth()).getDate())),d==bD.week&&(e=this.getDay()),this[d[1]](this[d[0]]()+b),!e||this.setDate(this.getDate()+e),this)}function D(a,b){return this>=a&&this<=b}function E(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}function F(){return new Date(this.getTime())}function G(){return Y.setLeapYear(this),Y.day_count.slice(0,this.getMonth()).reduce(o,0)+this.getDate()-1}function H(){return new Date(this.getFullYear(),this.getMonth(),1)}function I(){return Math.floor(this.dayOfYear()/7)}function J(){return(new Date(this.getFullYear(),0,1)).getTimezoneOffset()!=this.getTimezoneOffset()}function K(){return Y.isLeapYear(this.getFullYear())}function L(){var a=this.getMonth();return Y.setLeapYear(this),new Date(this.getFullYear(),a,Y.day_count[a])}function M(a){return this.setMonth(0),this.setDate(1),this.adjust(Date.DAY,a*7).getTime()}function N(){var a=this.toString().split(" ");return a.splice(4,a.length).join(" ").replace(bN,"$1").replace(bO,"")}function O(a){if(bw[a])return bw[a];var b=["var out=[];"],c,d=a.replace(bH,bu).replace(bG,bv).split(bM),e=-1,f=d.length;while(++e<f){c=d[e];if(c==bt){b.push('out.push( "'+d[++e]+'" )'),++e;continue}b.push(P(c))}return b.push('return out.join( "" );'),bw[a]=new Function("filter","date",b.join("\n"))}function P(a){return a.replace(bI,function(a,b,c,d){return'out.push( "'+b+'", filter.'+c+'( date ), "'+d+'" );'})}function Q(a){return O(a)(bA,this)}function R(a){if(bx[a])return bx[a];var b={},c=[],d=-1,f=a.replace(bH,bu).replace(bG,bv).split(bM),h=f.length,i,j=[];while(++d<h){i=f[d];if(i==bt){j.push(f[++d]),++d;continue}i.replace(bI,function(a,d,f,h){var i,k,l;if(!(l=bE[f]))return;l.k&&(c.push(l.k),l.fn&&(b[l.k]=l.fn)),l.combo&&(k=m(l.combo,"k"),i=e(m(l.combo,"fn"),k),c.push.apply(c,k),g(b,i,_)),l.re&&j.push(d,l.re,h)})}return bx[a]=S.bind(Z,new RegExp(j.join("")),c,b)}function S(a,b,c,d){var f=new Date,g=d.match(a),i=e(g.slice(1),b);return h(i,function(a,b){c[b]&&(i[b]=c[b](a,i))}),isNaN(i[bq])?(U(f,i[bk],i[bm],i[bo],i[bl]),T(f,i),V(f,i[bp])):f.setTime(i[bq]),f}function T(a,b){var c,d,e,g=-1;if(bz.every(i.bind(Z,b)))return;isNaN(b[bs])&&(b[bs]=a.getFullYear());if(isNaN(b[bn])){d=Y.isLeapYear(b[bs])?1:0,e=Y.ordinal_day_count[d],l=e.length,b[bn]=0,b[br]&&!b[bj]&&(c=b[bi],c=isNaN(c)?0:c?c:7,b[bj]=b[br]*7-(4-c));if(!isNaN(b[bj])){b[bj]>e[e.length-1]&&(b[bj]-=e[e.length-1],++b[bs]);while(++g<l)if(f(b[bj],e[g],e[g+1])){b[bn]=g,b[bh]=e[g]==0?b[bj]:b[bj]-e[g];break}}}isNaN(b[bh])&&(b[bh]=1),a.setYear(b[bs]),a.setMonth(b[bn]),a.setDate(b[bh])}function U(a,b,c,d,e){a.setHours(b||0),a.setMinutes(c||0),a.setSeconds(d||0),a.setMilliseconds(e||0)}function V(a,b){if(!f(b,-43200,50400))return;a.adjust(Date[bo],-a.getTimezoneOffset()*60-b)}function W(a,b){return R(b)(a)}var X=!1,Y=Date.locale,Z=null,$=Object.prototype,_=!0,ba,bb=[9,1,0,-1,-2,4,3],bc=864e5,bd=6048e5,be=Y.days.map(c),bf=Y.months.map(c),bg="ampm",bh="day",bi="dayweek",bj="dayyear",bk="hour",bl="ms",bm="minute",bn="month",bo="second",bp="timezone",bq="unix",br="week",bs="year",bt="NOREPLACE",bu="<"+bt+"<",bv=">END"+bt+">",bw={},bx={},by,bz=[bh,bi,bj,bn,br,bs],bA,bB=g({ISO_8601:"Y-m-d<T>H:i:s.u<Z>",ISO_8601_SHORT:"Y-m-d",RFC_850:"l, d-M-y H:i:s T",RFC_2822:"D, d M Y H:i:s O",sortable:"Y-m-d H:i:sO"},Y.formats),bC,bD={day:["getDate","setDate"],hr:["getHours","setHours"],min:["getMinutes","setMinutes"],month:["getMonth","setMonth"],ms:["getMilliseconds","setMilliseconds"],sec:["getSeconds","setSeconds"],week:["getWeek","setWeek"],year:["getFullYear","setFullYear"]},bE,bF="(am|pm)",bG=/>/g,bH=/</g,bI,bJ="([0-9]{1,2})",bK="([0-9]{2})",bL="([0-9]{4})",bM=/[<>]/,bN=/[^\(]*\(([^\)]+)\)/g,bO=/[^A-Z]+/g;bB.atom=bB.ISO_8601,bB.cookie=bB.RFC_850,bB.rss=bB.RFC_2822,bA={d:function(a){return k(a.getDate(),2)},D:function(a){return Y.days[a.getDay()].substring(0,3)},j:function(a){return a.getDate()},l:function(a){return Y.days[a.getDay()]},N:function(a){return a.ISODay()},S:function(a){return Y.getOrdinal(a.getDate())},w:function(a){return a.getDay()},z:function(a){return a.dayOfYear()},W:function(a){return a.ISOWeek()},F:function(a){return Y.months[a.getMonth()]},m:function(a){return k(a.getMonth()+1,2)},M:function(a){return Y.months[a.getMonth()].substring(0,3)},n:function(a){return a.getMonth()+1},t:function(a){return Y.setLeapYear(a),Y.day_count[a.getMonth()]},L:function(a){return a.isLeapYear()?1:0},o:function(a){var b=a.getMonth(),c=a.ISOWeek();return a.getFullYear()+(c==1&&b>0?1:c>=52&&b<11?-1:0)},Y:function(a){return a.getFullYear()},y:function(a){return String(a.getFullYear()).substring(2,4)},a:function(a){return b(a.getHours()<12?Y.AM:Y.PM)},A:function(a){return d(a.getHours()<12?Y.AM:Y.PM)},g:function(a){return a.getHours()%12||12},G:function(a){return a.getHours()},h:function(a){return k(bA.g(a),2)},H:function(a){return k(bA.G(a),2)},i:function(a){return k(a.getMinutes(),2)},s:function(a){return k(a.getSeconds(),2)},u:function(a){return k(a.getMilliseconds(),3)},O:function(a){return a.GMTOffset()},P:function(a){return a.GMTOffset(_)},T:function(a){return a[bp]()},Z:function(a){return a.getTimezoneOffset()*-60},c:function(a){return Q(a,bB.ISO_8601)},r:function(a){return Q(a,bB.RFC_2822)},U:function(a){return a.getTime()}},by=Object.keys(bA).sort().join(""),bI=new RegExp("([^"+by+"]*)(["+by+"])([^"+by+"]*)","g"),bE={d:{k:bh,fn:Number,re:bK},D:{k:bi,fn:a.bind(Z,be),re:"("+be.join("|")+")"},j:{k:bh,fn:Number,re:bJ},l:{k:bi,fn:a.bind(Z,Y.days),re:"("+Y.days.join("|")+")"},N:{k:bi,fn:v.bind(Z,7),re:"([1-7])"},S:{re:"(?:"+Y.ordinal.join("|")+")"},w:{k:bi,fn:Number,re:"([0-6])"},z:{k:bj,fn:Number,re:"([0-9]{1,3})"},W:{k:br,fn:Number,re:bK},F:{k:bn,fn:a.bind(Z,Y.months),re:"("+Y.months.join("|")+")"},m:{k:bn,fn:v,re:bK},M:{k:bn,fn:a.bind(Z,bf),re:"("+bf.join("|")+")"},n:{k:bn,fn:v,re:bJ},t:{re:"[0-9]{2}"},L:{re:"(?:0|1)"},o:{k:bs,fn:Number,re:bL},Y:{k:bs,fn:Number,re:bL},y:{k:bs,fn:function(a){return a=Number(a),a+=a<30?2e3:1900},re:bK},a:{k:bg,fn:n,re:bF},A:{k:bg,fn:b,re:d(bF)},g:{k:bk,fn:q,re:bJ},G:{k:bk,fn:Number,re:bJ},h:{k:bk,fn:q,re:bK},H:{k:bk,fn:Number,re:bK},i:{k:bm,fn:Number,re:bK},s:{k:bo,fn:Number,re:bK},u:{k:bl,fn:Number,re:"([0-9]{1,})"},O:{k:bp,fn:t,re:"([\\+-][0-9]{4})"},P:{k:bp,fn:t,re:"([\\+-][0-9]{2}:[0-9]{2})"},T:{re:"[A-Z]{1,4}"},Z:{k:bp,fn:Number,re:"([\\+-]?[0-9]{5})"},U:{k:bq,fn:Number,re:"(-?[0-9]{1,})"}},bE.c={combo:[bE.Y,bE.m,bE.d,bE.H,bE.i,bE.s,bE.P],re:[bE.Y.re,"-",bE.m.re,"-",bE.d.re,"T",bE.H.re,":",bE.i.re,":",bE.s.re,bE.P.re].join("")},bE.r={combo:[bE.D,bE.d,bE.M,bE.Y,bE.H,bE.i,bE.s,bE.O],re:[bE.D.re,", ",bE.d.re," ",bE.M.re," ",bE.Y.re," ",bE.H.re,":",bE.i.re,":",bE.s.re," ",bE.O.re].join("")},Object.defineProperties(Date.prototype,h({GMTOffset:w,ISODay:x,ISODaysInYear:y,ISOFirstMondayOfYear:z,ISOWeek:A,ISOWeeksInYear:B,adjust:C,between:D,clearTime:E,clone:F,dayOfYear:G,firstOfTheMonth:H,format:Q,getWeek:I,isDST:J,isLeapYear:K,lastOfTheMonth:L,setWeek:M,timezone:N},p)),Object.defineProperties(Date,h({DAY:bh,HOUR:"hr",MINUTE:bm.substring(0,3),MILLISECOND:bl,MONTH:bn,SECOND:bo.substring(0,3),WEEK:br,YEAR:bs,MS_DAY:bc,MS_WEEK:bd,MS_MONTH:2592e6,MS_YEAR:31536e6,filters:bA,formats:bB,parsers:bE,getOrdinal:Y.getOrdinal,isLeapYear:Y.isLeapYear,setLeapYear:Y.setLeapYear,toDate:W},p))}()

@@ -17,3 +17,3 @@ {

},
"version" : "0.0.4"
"version" : "0.0.5"
}

@@ -61,3 +61,3 @@ // private methods

function clone() { return new Date( this.valueOf() ); }
function clone() { return new Date( this.getTime() ); }

@@ -82,3 +82,3 @@ function dayOfYear() {

function setWeek( v ) { this.setMonth( 0 ); this.setDate( 1 ); return ( this.adjust( Date.DAY, v * 7 ) ).valueOf(); }
function setWeek( v ) { this.setMonth( 0 ); this.setDate( 1 ); return ( this.adjust( Date.DAY, v * 7 ) ).getTime(); }

@@ -85,0 +85,0 @@ function timezone() {

@@ -14,4 +14,4 @@ var F = !1, LOCALE = Date.locale, N = null, OP = Object.prototype, T = !0, U,

filter, formats = copy( {
ISO_8601 : 'Y-m-d<T>H:i:sP', ISO_8601_SHORT : 'Y-m-d',
RFC_850 : 'l, d-M-y H:i:s T', RFC_2822 : 'D, d M Y H:i:s O',
ISO_8601 : 'Y-m-d<T>H:i:s.u<Z>', ISO_8601_SHORT : 'Y-m-d',
RFC_850 : 'l, d-M-y H:i:s T', RFC_2822 : 'D, d M Y H:i:s O',
sortable : 'Y-m-d H:i:sO'

@@ -30,46 +30,46 @@ }, LOCALE.formats ),

// day
d : function( d ) { return pad( d.getDate(), 2 ); }, // Day of the month, 2 digits with leading zeros
D : function( d ) { return LOCALE.days[d.getDay()].substring( 0, 3 ); }, // A textual representation of a day, three letters
j : function( d ) { return d.getDate(); }, // Day of the month without leading zeros
l : function( d ) { return LOCALE.days[d.getDay()]; }, // A full textual representation of the day of the week
N : function( d ) { return d.ISODay(); }, // ISO-8601 numeric representation of the day of the week
S : function( d ) { return LOCALE.getOrdinal( d.getDate() ); }, // English ordinal suffix for the day of the month, 2 characters
w : function( d ) { return d.getDay(); }, // Numeric representation of the day of the week
z : function( d ) { return d.dayOfYear(); }, // The day of the year (starting from 0)
d : function( d ) { return pad( d.getDate(), 2 ); }, // Day of the month, 2 digits with leading zeros
D : function( d ) { return LOCALE.days[d.getDay()].substring( 0, 3 ); }, // A textual representation of a day, three letters
j : function( d ) { return d.getDate(); }, // Day of the month without leading zeros
l : function( d ) { return LOCALE.days[d.getDay()]; }, // A full textual representation of the day of the week
N : function( d ) { return d.ISODay(); }, // ISO-8601 numeric representation of the day of the week
S : function( d ) { return LOCALE.getOrdinal( d.getDate() ); }, // English ordinal suffix for the day of the month, 2 characters
w : function( d ) { return d.getDay(); }, // Numeric representation of the day of the week
z : function( d ) { return d.dayOfYear(); }, // The day of the year (starting from 0)
// week
W : function( d ) { return d.ISOWeek(); }, // ISO-8601 week number of year, weeks starting on Monday
W : function( d ) { return d.ISOWeek(); }, // ISO-8601 week number of year, weeks starting on Monday
// month
F : function( d ) { return LOCALE.months[d.getMonth()]; }, // A full textual representation of a month
m : function( d ) { return pad( ( d.getMonth() + 1 ), 2 ); }, // Numeric representation of a month, with leading zeros
M : function( d ) { return LOCALE.months[d.getMonth()].substring( 0, 3 ); }, // A short textual representation of a month, three letters
n : function( d ) { return d.getMonth() + 1; }, // Numeric representation of a month, without leading zeros
F : function( d ) { return LOCALE.months[d.getMonth()]; }, // A full textual representation of a month
m : function( d ) { return pad( ( d.getMonth() + 1 ), 2 ); }, // Numeric representation of a month, with leading zeros
M : function( d ) { return LOCALE.months[d.getMonth()].substring( 0, 3 ); }, // A short textual representation of a month, three letters
n : function( d ) { return d.getMonth() + 1; }, // Numeric representation of a month, without leading zeros
t : function( d ) { LOCALE.setLeapYear( d ); return LOCALE.day_count[d.getMonth()]; }, // Number of days in the given month
// year
L : function( d ) { return ( d.isLeapYear() ) ? 1 : 0; }, // Whether it's a leap year
o : function( d ) { // ISO-8601 year number. This has the same value as Y, except that if the ISO
var m = d.getMonth(), w = d.ISOWeek(); // week number (W) belongs to the previous or next year, that year is used instead.
L : function( d ) { return ( d.isLeapYear() ) ? 1 : 0; }, // Whether it's a leap year
o : function( d ) { // ISO-8601 year number. This has the same value as Y, except that if the ISO
var m = d.getMonth(), w = d.ISOWeek(); // week number (W) belongs to the previous or next year, that year is used instead.
return ( d.getFullYear() + ( w == 1 && m > 0 ? 1 : ( w >= 52 && m < 11 ? -1 : 0 ) ) );
},
Y : function( d ) { return d.getFullYear(); }, // A full numeric representation of a year, 4 digits
y : function( d ) { return String( d.getFullYear() ).substring( 2, 4 ); }, // A two digit representation of a year
Y : function( d ) { return d.getFullYear(); }, // A full numeric representation of a year, 4 digits
y : function( d ) { return String( d.getFullYear() ).substring( 2, 4 ); }, // A two digit representation of a year
// time
a : function( d ) { return _lc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Lowercase Ante meridiem and Post meridiem
A : function( d ) { return _uc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Uppercase Ante meridiem and Post meridiem
g : function( d ) { return d.getHours() % 12 || 12; }, // 12-hour format of an hour without leading zeros
G : function( d ) { return d.getHours(); }, // 24-hour format of an hour without leading zeros
h : function( d ) { return pad( filter.g( d ), 2 ); }, // 12-hour format of an hour with leading zeros
H : function( d ) { return pad( filter.G( d ), 2 ); }, // 24-hour format of an hour with leading zeros
i : function( d ) { return pad( d.getMinutes(), 2 ); }, // Minutes with leading zeros
s : function( d ) { return pad( d.getSeconds(), 2 ); }, // Seconds, with leading zeros
u : function( d ) { return pad( d.getMilliseconds(), 3 ); }, // Milliseconds
a : function( d ) { return _lc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Lowercase Ante meridiem and Post meridiem
A : function( d ) { return _uc( d.getHours() < 12 ? LOCALE.AM : LOCALE.PM ); }, // Uppercase Ante meridiem and Post meridiem
g : function( d ) { return d.getHours() % 12 || 12; }, // 12-hour format of an hour without leading zeros
G : function( d ) { return d.getHours(); }, // 24-hour format of an hour without leading zeros
h : function( d ) { return pad( filter.g( d ), 2 ); }, // 12-hour format of an hour with leading zeros
H : function( d ) { return pad( filter.G( d ), 2 ); }, // 24-hour format of an hour with leading zeros
i : function( d ) { return pad( d.getMinutes(), 2 ); }, // Minutes with leading zeros
s : function( d ) { return pad( d.getSeconds(), 2 ); }, // Seconds, with leading zeros
u : function( d ) { return pad( d.getMilliseconds(), 3 ); }, // Milliseconds
// timezone
O : function( d ) { return d.GMTOffset(); }, // Difference to Greenwich time (GMT) in hours
P : function( d ) { return d.GMTOffset( T ); }, // Difference to Greenwich time (GMT) with colon between hours and minutes
T : function( d ) { return d[TIMEZONE](); }, // Timezone abbreviation
Z : function( d ) { return d.getTimezoneOffset() * -60; }, // Timezone offset in seconds. The offset for timezones west of UTC
// is always negative, and for those east of UTC is always positive.
O : function( d ) { return d.GMTOffset(); }, // Difference to Greenwich time (GMT) in hours
P : function( d ) { return d.GMTOffset( T ); }, // Difference to Greenwich time (GMT) with colon between hours and minutes
T : function( d ) { return d[TIMEZONE](); }, // Timezone abbreviation
Z : function( d ) { return d.getTimezoneOffset() * -60; }, // Timezone offset in seconds. The offset for timezones west of UTC
// is always negative, and for those east of UTC is always positive.
// full date/time
c : function( d ) { return format( d, formats.ISO_8601 ); }, // ISO 8601 date
r : function( d ) { return format( d, formats.RFC_2822 ); }, // RFC 2822 formatted date
U : function( d ) { return d.getTime(); } // Seconds since the Unix Epoch January 1 1970 00:00:00 GMT
c : function( d ) { return format( d, formats.ISO_8601 ); }, // ISO 8601 date
r : function( d ) { return format( d, formats.RFC_2822 ); }, // RFC 2822 formatted date
U : function( d ) { return d.getTime(); } // Seconds since the Unix Epoch January 1 1970 00:00:00 GMT
};

@@ -76,0 +76,0 @@

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