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.4.2 to 0.4.3

37

d8.js

@@ -9,3 +9,2 @@ ;!function( util ) {

// utility methods

@@ -27,6 +26,4 @@ function _indexOf( o, k ) { var i = o.indexOf( k ); return i == -1 ? null : i; }

/*~ src/vars.js ~*/
var U,

@@ -65,6 +62,4 @@ // DAY_OFFSETS is the amount of days from the current day to the Monday of the week it belongs to

/*~ src/coerce.js ~*/
function coerce( date_str, date_format ) {

@@ -124,2 +119,5 @@ return buildParser( date_format )( date_str );

// if ( date.isDST() )
// date.setHours( date.getHours() + 1 );
return date;

@@ -177,6 +175,4 @@ }

/*~ src/diff.js ~*/
function diff( now, props ) { //noinspection FallthroughInSwitchStatementJS

@@ -322,6 +318,4 @@ switch ( util.ntype( now ) ) {

/*~ src/fns.js ~*/
// private methods

@@ -341,3 +335,7 @@ function _24hrTime( o, res ) { return ( o = Number( o ) ) < 12 && _lc( res.ampm ) == _lc( Type.locale.PM ) ? o += 12 : o; }

function _dayOffset( d ) { return Math.floor( ( d - getISOFirstMondayOfYear.call( d ) ) / MS_DAY ); }
function _hours( d ) { return d.getHours() + ( d.isDST() ? 1 : 0 ); }
function _timezoneOffset( o ) {
if ( o == 'Z' ) {
o = '0000';
}
var t = !!o.indexOf( '-' ),

@@ -438,6 +436,4 @@ m = o.match( re_tz_off ),

/*~ src/format.js ~*/
function buildTemplate( date_format ) {

@@ -474,6 +470,4 @@ var LID = Type.locale.id, fn, i, l, part, parts, re_invalid;

/*~ src/lexicalize.js ~*/
function lexicalize( now, precision ) {

@@ -592,6 +586,4 @@ if ( !valid( now ) ) {

/*~ src/localize.js ~*/
function localize( locale ) { //noinspection FallthroughInSwitchStatementJS

@@ -635,6 +627,4 @@ switch ( util.ntype( locale ) ) {

/*~ src/filters.js ~*/
function localize_filters( L ) {

@@ -707,10 +697,8 @@ var F = {

/*~ src/formats.js ~*/
function localize_formats( L ) {
var F = util.copy( {
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',
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'

@@ -728,6 +716,4 @@ }, L.formats );

/*~ src/parsers.js ~*/
function localize_parsers( L ) {

@@ -774,3 +760,3 @@ var P = {

T : { re : '[A-Z]{1,4}' },
Z : { k : TIMEZONE, fn : Number, re : '([\\+-]?[0-9]{5})' },
Z : { k : TIMEZONE, fn : _timezoneOffset, re : '(Z|[\\+-]?[0-9]{2}:?[0-9]{2})' },
// full date/time

@@ -782,3 +768,3 @@ U : { k : UNIX, fn : Number, re : '(-?[0-9]{1,})' }

combo : [P.Y, P.m, P.d, P.H, P.i, P.s, P.u, P.P],
re : [P.Y.re, '-', P.m.re, '-', P.d.re, 'T', P.H.re, ':', P.i.re, ':', P.s.re, '(?:\\.', P.u.re, '){0,1}', P.P.re, '{0,1}'].join( '' )
re : [P.Y.re, '-', P.m.re, '-', P.d.re, 'T', P.H.re, ':', P.i.re, ':', P.s.re, '(?:\\.', P.u.re, '){0,1}', P.Z.re, '{0,1}'].join( '' )
};

@@ -797,6 +783,4 @@ P.r = {

/*~ src/expose.js ~*/
// instance methods

@@ -832,3 +816,2 @@ util.defs( Type.prototype, {

} ).x( Date );

@@ -835,0 +818,0 @@ // at this point we don't know if util is available or not, and as such do not know what environment we are in.

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

!function(e){"use strict";e.x.cache("Date",function(t){function n(e,t){var n=e.indexOf(t);return-1==n?null:n}function r(e){return e.toLocaleLowerCase()}function i(e){return e.toLocaleUpperCase()}function u(e,t){return e.reduce(function(e,n,r){return e[t[r]]=n,e},{})}function s(e,t,n){return e>=t&&n>=e}function a(e,t,n){var r=-1,i=e.toString(n||10);for(t-=i.length;t>++r;)i="0"+i;return i}function o(e,t){return e+t}function c(e,t){return l(t)(e)}function l(n){var r,i,s,a,o,c,l,h=t.locale.id;if(At[h][n])return At[h][n];for(c=n.replace(Pt,Lt).replace(Wt,Ft).split(Vt),i=[],r=-1,s=c.length,a={},l=[];s>++r;)o=c[r],o!=Tt?o.replace(ct,function(t,n,r,s){var o,c,f;(f=ot[r])&&(f.k&&(i.push(f.k),f.fn&&(a[f.k]=f.fn)),f.combo&&(c=f.combo.pluck("k"),o=u(f.combo.pluck("fn"),c),i.push.apply(i,c),e.copy(a,o,!0)),f.re&&l.push(n,f.re,s))}):(l.push(c[++r]),++r);return At[h][n]=f.bind(null,RegExp(l.join("")),i,a)}function f(e,n,r,i){var s=new t,a=i.match(e),o=u(a.slice(1),n);return Object.reduce(o,function(e,t,n){return"string"==typeof t&&r[n]&&(o[n]=r[n](t,o)),e},null),isNaN(o[Dt])?(m(s,o[vt],o[wt],o[Yt],o[Nt]),h(s,o),g(s,o[jt])):s.setTime(o[Dt]),s}function h(n,r){var i,u,a,o,c=t.locale,l=-1;if(!Ct.every(e.has.bind(null,r))){if(isNaN(r[xt])&&(r[xt]=n.getFullYear()),isNaN(r[Ot])&&(a=c.isLeapYear(r[xt])?1:0,o=c.ordinal_day_count[a],u=o.length,r[Ot]=0,r[St]&&!r[yt]&&(i=r[Mt],i=isNaN(i)?0:i?i:7,r[yt]=7*r[St]-(4-i)),!isNaN(r[yt])))for(r[yt]>o[o.length-1]&&(r[yt]-=o[o.length-1],++r[xt]);u>++l;)if(s(r[yt],o[l],o[l+1])){r[Ot]=l,r[kt]=0==o[l]?r[yt]:r[yt]-o[l];break}isNaN(r[kt])&&(r[kt]=1),n.setYear(r[xt]),n.setMonth(r[Ot]),n.setDate(r[kt])}}function m(e,t,n,r,i){e.setHours(t||0),e.setMinutes(n||0),e.setSeconds(r||0),e.setMilliseconds(i||0)}function g(e,n){!s(n,-43200,50400)||e.adjust(t.SECOND,60*-e.getTimezoneOffset()-n)}function d(n,r){switch(e.ntype(n)){case"number":case"string":if(!q(new t(n))){r||(r=n),n=t.now();break}n=new t(n);case"array":case"object":r=n,n=t.now();break;case"date":if(q(new t(+n)))break;default:n=t.now()}var i,u=+n-+this,s=0>u?1:u>0?-1:0;return s?i=b(Math.abs(u),_(r)):(i=e.obj(),i.value=0),i.tense=s,i}function p(e,t,n,r){var i;return e.__ms__?e.excl[t[0]]?r[n+1]&&!e.excl[r[n+1][0]]||!(t=r[n-1])?e:(i=e.__ms__/t[1],e.__ms__=Math.round(i)*t[1]+e.__ms__/r[n][1]%1*r[n][1],p(e,t,n-1,[])):(e.__ms__>=t[1]&&(i=e.__ms__/t[1],t[0]in e.val?(i=Math.floor(i),e.__ms__-=i*t[1],e.val[t[0]]+=i):(e.__ms__=i%1*t[1],e.val[t[0]]=Math.floor(i))),e):e}function b(t,n){var r=Qt.reduce(p,{__ms__:t,excl:n,val:e.obj()}).val;return r.value=t,r}function _(t){var n=e.obj(),r=!0;if(t)switch(e.ntype(t)){case"object":r=!1;break;case"string":t=t.split(" ");case"array":t=t.reduce(k,n),r=!!e.len(n)}return Xt.map(function(e){e in this||(this[e]=!r)},n),n}function k(e,t){var n=(t=(t+"").toLowerCase()).substring(1);switch(t.charAt(0)){case"-":e[n]=!0;break;case"+":e[n]=!1;break;case">":Qt.map(M,{excl:e,prop:n,val:!0});break;case"<":Qt.slice().reverse().map(M,{excl:e,prop:n,val:!1});break;default:e[t]=!1}return e}function M(e){e[0]===this.prop&&(this.SET_VALID=!0),this.SET_VALID&&(this.excl[e[0]]=this.val)}function y(t){return t=e.copy(t),e.remove(t,"tense","value"),Object.keys(t).map(function(e){return[Xt.indexOf(e),e]}).sort(function(e,t){return e=e[0],t=t[0],e>t?1:-1}).pluck(1)}function v(e,n){return 12>(e=Number(e))&&r(n.ampm)==r(t.locale.PM)?e+=12:e}function N(e,t,n){return e.adjust(n,t)}function w(t){return Et.reduce(function(e,n,r){var i=parseFloat(t[r]);return isNaN(i)||0===i||(e[n]=i),e},e.obj())}function O(e){return Math.floor((e-C.call(e))/ft)}function Y(e){var t=!!e.indexOf("-"),n=e.match(Jt),r=3600*(Number(n[1])+n[2]/60);return t?r:-r}function j(e){return Math.floor(Math.abs(O(e)/7))}function D(e,t){return isNaN(t)?Number(e)-1:t==e?0:Number(t)}function S(n,r){var i,u,s,a=this;switch(e.ntype(n)){case"number":n=arguments;case"array":n=w(n);case"object":Object.reduce(n,N,a);break;case"string":u=Ht[n.toLowerCase()],u&&0!==r&&(t.locale.setLeapYear(a),u==Ht.month&&(i=a.getDate(),28>i||a.setDate(Math.min(i,U.call(H.call(a).adjust(t.MONTH,r)).getDate()))),u!=Ht.week||(s=a.getDay()),a[u[1]](a[u[0]]()+r),!s||a.setDate(a.getDate()+s))}return a}function x(e,t){return+this>=+e&&+t>=+this}function T(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}function L(){return new t(this.getTime())}function F(){var e=t.locale;return e.setLeapYear(this),e.day_count.slice(0,this.getMonth()).reduce(o,0)+this.getDate()-1}function H(){return new t(this.getFullYear(),this.getMonth(),1)}function E(e){var t=this.getTimezoneOffset();return[t>0?"-":"+",a(Math.floor(Math.abs(t)/60),2),e?":":"",a(Math.abs(t%60),2)].join("")}function I(){return this.getDay()||7}function A(){return Math.ceil((C.call(new t(this.getFullYear()+1,0,1))-C.call(this))/ft)}function C(){var e=this.getFullYear();return new t(e,0,lt[new t(e,0,1).getDay()])}function z(){var e,n=this.getFullYear();return this>=C.call(new t(n+1,0,1))?1:(e=Math.floor((F.call(this)-I.call(this)+10)/7),0==e?R.call(new t(n-1,0,1))-j(this):e)}function R(){return Math.round((C.call(new t(this.getFullYear()+1,0,1))-C.call(this))/pt)}function U(){var e=t.locale,n=this.getMonth();return e.setLeapYear(this),new t(this.getFullYear(),n,e.day_count[n])}function W(){return Math.floor(F.call(this)/7)}function P(){return new t(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset()}function Z(){return t.locale.isLeapYear(this.getFullYear())}function G(e){return this.setMonth(0),this.setDate(1),this.adjust(t.DAY,7*e).getTime()}function K(){var e=(""+this).split(" ");return e.splice(4,e.length).join(" ").replace($t,"$1").replace(Bt,"")}function q(t){return"date"==e.ntype(t)&&!isNaN(+t)}function V(e){var n,r,i,u,s,a,o=t.locale.id;if(It[o][e])return It[o][e];for(n=[" var out=[];"],s=e.replace(Pt,Lt).replace(Wt,Ft).split(Vt),a=/^[^A-Za-z]*$/g,r=-1,i=s.length;i>++r;)u=s[r],u==Tt?(n.push(J(s[++r])),++r):a.test(u)?n.push(J(u)):n.push(B(u));return n.push('return out.join( "" );\n //@ sourceURL=d8/format/'+o+"/"+e),It[o][e]=Function("filter","date",n.join("\n\n "))}function $(e){return V(e)(ut,this)}function B(e){return e.replace(ct,function(e,t,n,r){return J(t+"', filter."+n+"( date ), '"+r)})}function J(e){return"out.push( '"+e+"' );"}function Q(e,n){q(e)||(q(new t(e))?e=new t(e):(n=e,e=t.now()));var r=t.locale.lexicon;return"function"!=typeof zt[n=(n+"").toLowerCase()]&&(n=r.DEFAULT),+e-+this?zt[n].call(r,this,e).replace(qt," "):r.just_now}function X(e){return e.join(" ")}function et(e,t){var n=e.pop();return(e.length?e.join(this.delim)+" "+this.and+" "+n:n)+" "+this[1>t.tense?"ago":"from_now"]}function tt(n){switch(e.ntype(n)){case"object":if(n.id){Rt[n.id]=n;break}case"string":if(n in Rt){n=Rt[n];break}default:n=null}return"object"==e.ntype(n)&&(e.defs(t,{locale:{value:n},getOrdinal:n.getOrdinal,isLeapYear:n.isLeapYear,setLeapYear:n.setLeapYear},"w",!0),n.id in It||(It[n.id]=e.obj()),n.id in At||(At[n.id]=e.obj()),ut=nt(n),at=rt(n),ot=it(n)),t}function nt(n){var u={d:function(e){return a(e.getDate(),2)},D:function(e){return n.days[e.getDay()].substring(0,3)},j:function(e){return e.getDate()},l:function(e){return n.days[e.getDay()]},N:function(e){return I.call(e)},S:function(e){return n.getOrdinal(e.getDate())},w:function(e){return e.getDay()},z:function(e){return e.getDayOfYear()},W:function(e){return z.call(e)},F:function(e){return n.months[e.getMonth()]},m:function(e){return a(e.getMonth()+1,2)},M:function(e){return n.months[e.getMonth()].substring(0,3)},n:function(e){return e.getMonth()+1},t:function(e){return n.setLeapYear(e),n.day_count[e.getMonth()]},L:function(e){return e.isLeapYear()?1:0},o:function(e){var t=e.getMonth(),n=z.call(e);return e.getFullYear()+(1==n&&t>0?1:n>=52&&11>t?-1:0)},Y:function(e){return e.getFullYear()},y:function(e){return(e.getFullYear()+"").substring(2,4)},a:function(e){return r(12>e.getHours()?n.AM:n.PM)},A:function(e){return i(12>e.getHours()?n.AM:n.PM)},g:function(e){return e.getHours()%12||12},G:function(e){return e.getHours()},h:function(e){return a(ut.g(e),2)},H:function(e){return a(ut.G(e),2)},i:function(e){return a(e.getMinutes(),2)},s:function(e){return a(e.getSeconds(),2)},u:function(e){return a(e.getMilliseconds(),3)},O:function(e){return E.call(e)},P:function(e){return E.call(e,!0)},T:function(e){return K.call(e)},Z:function(e){return-60*e.getTimezoneOffset()},c:function(e){return $.call(e,at.ISO_8601)},r:function(e){return $.call(e,at.RFC_2822)},U:function(e){return e.getTime()},e:function(e){return e.lexicalize("exact")},x:function(e){return e.lexicalize("approx")}};return st=Object.keys(u).sort().join(""),ct=RegExp("([^"+st+"]*)(["+st+"])([^"+st+"]*)","g"),e.def(t,"filters",{value:ut=u},"w",!0),u}function rt(n){var r=e.copy({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"},n.formats);return r.atom=r.ISO_8601,r.cookie=r.RFC_850,r.rss=r.RFC_2822,e.def(t,"formats",{value:at=r},"w",!0),r}function it(u){var s={d:{k:kt,fn:Number,re:Gt},D:{k:Mt,fn:n.bind(null,u.days_short),re:"("+u.days_short.join("|")+")"},j:{k:kt,fn:Number,re:Zt},l:{k:Mt,fn:n.bind(null,u.days),re:"("+u.days.join("|")+")"},N:{k:Mt,fn:D.bind(null,7),re:"([1-7])"},S:{re:"(?:"+u.ordinal.join("|")+")"},w:{k:Mt,fn:Number,re:"([0-6])"},z:{k:yt,fn:Number,re:"([0-9]{1,3})"},W:{k:St,fn:Number,re:Gt},F:{k:Ot,fn:n.bind(null,u.months),re:"("+u.months.join("|")+")"},m:{k:Ot,fn:D,re:Gt},M:{k:Ot,fn:n.bind(null,u.months_short),re:"("+u.months_short.join("|")+")"},n:{k:Ot,fn:D,re:Zt},t:{re:"[0-9]{2}"},L:{re:"(?:0|1)"},o:{k:xt,fn:Number,re:Kt},Y:{k:xt,fn:Number,re:Kt},y:{k:xt,fn:function(e){return e=Number(e),e+=30>e?2e3:1900},re:Gt},a:{k:_t,fn:e,re:Ut},A:{k:_t,fn:r,re:i(Ut)},g:{k:vt,fn:v,re:Zt},G:{k:vt,fn:Number,re:Zt},h:{k:vt,fn:v,re:Gt},H:{k:vt,fn:Number,re:Gt},i:{k:wt,fn:Number,re:Gt},s:{k:Yt,fn:Number,re:Gt},u:{k:Nt,fn:Number,re:"([0-9]{1,})"},O:{k:jt,fn:Y,re:"([\\+-][0-9]{4})"},P:{k:jt,fn:Y,re:"([\\+-][0-9]{2}:[0-9]{2})"},T:{re:"[A-Z]{1,4}"},Z:{k:jt,fn:Number,re:"([\\+-]?[0-9]{5})"},U:{k:Dt,fn:Number,re:"(-?[0-9]{1,})"}};return s.c={combo:[s.Y,s.m,s.d,s.H,s.i,s.s,s.u,s.P],re:[s.Y.re,"-",s.m.re,"-",s.d.re,"T",s.H.re,":",s.i.re,":",s.s.re,"(?:\\.",s.u.re,"){0,1}",s.P.re,"{0,1}"].join("")},s.r={combo:[s.D,s.d,s.M,s.Y,s.H,s.i,s.s,s.O],re:[s.D.re,", ",s.d.re," ",s.M.re," ",s.Y.re," ",s.H.re,":",s.i.re,":",s.s.re," ",s.O.re].join("")},e.def(t,"parsers",{value:ot=s},"w",!0),s}var ut,st,at,ot,ct,lt=[9,1,0,-1,-2,4,3],ft=864e5,ht=36e5,mt=6e4,gt=2592e6,dt=1e3,pt=6048e5,bt=31536e6,_t="ampm",kt="day",Mt="dayweek",yt="dayyear",vt="hour",Nt="ms",wt="minute",Ot="month",Yt="second",jt="timezone",Dt="unix",St="week",xt="year",Tt="NOREPLACE",Lt="<"+Tt+"<",Ft=">END"+Tt+">",Ht={day:["getDate","setDate"],hr:["getHours","setHours"],min:["getMinutes","setMinutes"],month:["getMonth","setMonth"],ms:["getMilliseconds","setMilliseconds"],sec:["getSeconds","setSeconds"],week:["getWeek","setWeek"],year:["getFullYear","setFullYear"]},Et=[xt,Ot,St,kt,"hr",wt.substring(0,3),Yt.substring(0,3),Nt],It=e.obj(),At=e.obj(),Ct=[kt,Mt,yt,Ot,St,xt],zt=e.obj(),Rt=e.obj(),Ut="(am|pm)",Wt=/>/g,Pt=/</g,Zt="([0-9]{1,2})",Gt="([0-9]{2})",Kt="([0-9]{4})",qt=/\s{2,}/g,Vt=/[<>]/,$t=/[^\(]*\(([^\)]+)\)/g,Bt=/[^A-Z]+/g,Jt=/[\+-]?([0-9]{2}):?([0-9]{2})/,Qt=[[xt+"s",bt],[Ot+"s",gt],[St+"s",pt],[kt+"s",ft],[vt+"s",ht],[wt+"s",mt],[Yt+"s",dt],[Nt,1]],Xt=Qt.pluck(0);zt.approx=function(e,n){var r,i,u,s,a,o,c,l=this.a,f=e.diff(n),h=t.diffKeys(f),m=t.time_map,g=this.time_units;if(f.value<t.MS_MINUTE)return this.just_now;switch(h[0]){case"years":u=0;break;case"months":u=1;break;case"weeks":u=2;break;case"days":2>f.days&&(o=e.format("l")===n.format("l"),c=o||"hours"!=h[1]||25>f.hours),u=3;break;case"hours":o=e.format("l")===n.format("l"),c=f.hours/24>=.75,l=this.an,u=4;break;case"minutes":u=5}if(i=(f.value-m[u][1]*f[h[0]])/m[u][1],c)return o?this.today:f.tense>0?this.tomorrow:this.yesterday;if(s=[],a=f.tense>0?this.from_now:this.ago,.1>i)switch(h[0]){case"years":case"months":case"weeks":if(1===f[h[0]]){s.push(1>f.tense?this.last:this.next,g[u][0]);break}default:!i||s.push(this.about),s.push(f[h[0]],g[u][f[h[0]]>1?1:0],a)}else.74>i?.24>i?r=this.just_over:(r=i>.24&&.4>i?this.almost:this.about,s.push(this.and,this.a,this.half)):s.push(this.almost,f[h[0]]+1,g[u][1],a);return r&&(s.push(g[u][f[h[0]]>1||s.length?1:0],a),s.unshift(r,f[h[0]])),"function"==typeof this.approx?this.approx.call(this,s,f):X.call(this,s,f)},zt.exact=function(e,n){var r,i=e.diff(n),u=this.time_units;return r=t.time_map.reduce(function(e,t,n){var r=i[t[0]];return!r||!u[n]||e.push(r+" "+u[n][r>1?1:0]),e},[]),r.length?"function"==typeof this.exact?this.exact.call(this,r,i):et.call(this,r,i):this.just_now},e.defs(t.prototype,{adjust:S,between:x,clearTime:T,clone:L,diff:d,format:$,getDayOfYear:F,getFirstOfTheMonth:H,getGMTOffset:E,getISODay:I,getISODaysInYear:A,getISOFirstMondayOfYear:C,getISOWeek:z,getISOWeeksInYear:R,getLastOfTheMonth:U,getWeek:W,isDST:P,isLeapYear:Z,lexicalize:Q,setWeek:G,timezone:K,valid:function(){return t.valid(this)}},"r"),e.defs(t,{DAY:kt,HOUR:"hr",MINUTE:wt.substring(0,3),MILLISECOND:Nt,MONTH:Ot,SECOND:Yt.substring(0,3),WEEK:St,YEAR:xt,MS_DAY:ft,MS_HOUR:ht,MS_MINUTE:mt,MS_MONTH:gt,MS_SECOND:dt,MS_WEEK:pt,MS_YEAR:bt,lexicon:{value:zt},time_map:{value:Qt},time_props:{value:Xt},coerce:c,diffKeys:y,localize:tt,toDate:c,valid:q},"r")}).x(Date)}("undefined"!=typeof m8?m8:"undefined"!=typeof require?require("m8"):null);
!function(e){"use strict";e.x.cache("Date",function(t){function n(e,t){var n=e.indexOf(t);return-1==n?null:n}function r(e){return e.toLocaleLowerCase()}function i(e){return e.toLocaleUpperCase()}function u(e,t){return e.reduce(function(e,n,r){return e[t[r]]=n,e},{})}function s(e,t,n){return e>=t&&n>=e}function a(e,t,n){var r=-1,i=e.toString(n||10);for(t-=i.length;++r<t;)i="0"+i;return i}function o(e,t){return e+t}function c(e,t){return l(t)(e)}function l(n){var r,i,s,a,o,c,l,h=t.locale.id;if(At[h][n])return At[h][n];for(c=n.replace(Zt,Lt).replace(Wt,Ft).split(Vt),i=[],r=-1,s=c.length,a={},l=[];++r<s;)o=c[r],o!=Tt?o.replace(ct,function(t,n,r,s){var o,c,f;(f=ot[r])&&(f.k&&(i.push(f.k),f.fn&&(a[f.k]=f.fn)),f.combo&&(c=f.combo.pluck("k"),o=u(f.combo.pluck("fn"),c),i.push.apply(i,c),e.copy(a,o,!0)),f.re&&l.push(n,f.re,s))}):(l.push(c[++r]),++r);return At[h][n]=f.bind(null,new RegExp(l.join("")),i,a)}function f(e,n,r,i){var s=new t,a=i.match(e),o=u(a.slice(1),n);return Object.reduce(o,function(e,t,n){return"string"==typeof t&&r[n]&&(o[n]=r[n](t,o)),e},null),isNaN(o[Dt])?(g(s,o[vt],o[Nt],o[Yt],o[wt]),h(s,o),m(s,o[jt])):s.setTime(o[Dt]),s}function h(n,r){var i,u,a,o,c=t.locale,l=-1;if(!Ct.every(e.has.bind(null,r))){if(isNaN(r[xt])&&(r[xt]=n.getFullYear()),isNaN(r[Ot])&&(a=c.isLeapYear(r[xt])?1:0,o=c.ordinal_day_count[a],u=o.length,r[Ot]=0,r[St]&&!r[yt]&&(i=r[Mt],i=isNaN(i)?0:i?i:7,r[yt]=r[St]*7-(4-i)),!isNaN(r[yt])))for(r[yt]>o[o.length-1]&&(r[yt]-=o[o.length-1],++r[xt]);++l<u;)if(s(r[yt],o[l],o[l+1])){r[Ot]=l,r[kt]=o[l]==0?r[yt]:r[yt]-o[l];break}isNaN(r[kt])&&(r[kt]=1),n.setYear(r[xt]),n.setMonth(r[Ot]),n.setDate(r[kt])}}function g(e,t,n,r,i){e.setHours(t||0),e.setMinutes(n||0),e.setSeconds(r||0),e.setMilliseconds(i||0)}function m(e,n){!s(n,-43200,50400)||e.adjust(t.SECOND,-e.getTimezoneOffset()*60-n)}function d(n,r){switch(e.ntype(n)){case"number":case"string":if(!q(new t(n))){r||(r=n),n=t.now();break}n=new t(n);case"array":case"object":r=n,n=t.now();break;case"date":if(q(new t(+n)))break;default:n=t.now()}var i,u=+n-+this,s=0>u?1:u>0?-1:0;return s?i=b(Math.abs(u),_(r)):(i=e.obj(),i.value=0),i.tense=s,i}function p(e,t,n,r){var i;return e.__ms__?e.excl[t[0]]?r[n+1]&&!e.excl[r[n+1][0]]||!(t=r[n-1])?e:(i=e.__ms__/t[1],e.__ms__=Math.round(i)*t[1]+e.__ms__/r[n][1]%1*r[n][1],p(e,t,n-1,[])):(e.__ms__>=t[1]&&(i=e.__ms__/t[1],t[0]in e.val?(i=Math.floor(i),e.__ms__-=i*t[1],e.val[t[0]]+=i):(e.__ms__=i%1*t[1],e.val[t[0]]=Math.floor(i))),e):e}function b(t,n){var r=Qt.reduce(p,{__ms__:t,excl:n,val:e.obj()}).val;return r.value=t,r}function _(t){var n=e.obj(),r=!0;if(t)switch(e.ntype(t)){case"object":r=!1;break;case"string":t=t.split(" ");case"array":t=t.reduce(k,n),r=!!e.len(n)}return Xt.map(function(e){e in this||(this[e]=!r)},n),n}function k(e,t){var n=(t=String(t).toLowerCase()).substring(1);switch(t.charAt(0)){case"-":e[n]=!0;break;case"+":e[n]=!1;break;case">":Qt.map(M,{excl:e,prop:n,val:!0});break;case"<":Qt.slice().reverse().map(M,{excl:e,prop:n,val:!1});break;default:e[t]=!1}return e}function M(e){e[0]===this.prop&&(this.SET_VALID=!0),this.SET_VALID&&(this.excl[e[0]]=this.val)}function y(t){return t=e.copy(t),e.remove(t,"tense","value"),Object.keys(t).map(function(e){return[Xt.indexOf(e),e]}).sort(function(e,t){return e=e[0],t=t[0],e>t?1:-1}).pluck(1)}function v(e,n){return(e=Number(e))<12&&r(n.ampm)==r(t.locale.PM)?e+=12:e}function w(e,t,n){return e.adjust(n,t)}function N(t){return Et.reduce(function(e,n,r){var i=parseFloat(t[r]);return isNaN(i)||0===i||(e[n]=i),e},e.obj())}function O(e){return Math.floor((e-C.call(e))/ft)}function Y(e){"Z"==e&&(e="0000");var t=!!e.indexOf("-"),n=e.match(Jt),r=(Number(n[1])+n[2]/60)*3600;return t?r:-r}function j(e){return Math.floor(Math.abs(O(e)/7))}function D(e,t){return isNaN(t)?Number(e)-1:t==e?0:Number(t)}function S(n,r){var i,u,s,a=this;switch(e.ntype(n)){case"number":n=arguments;case"array":n=N(n);case"object":Object.reduce(n,w,a);break;case"string":u=Ht[n.toLowerCase()],u&&0!==r&&(t.locale.setLeapYear(a),u==Ht.month&&(i=a.getDate(),28>i||a.setDate(Math.min(i,U.call(H.call(a).adjust(t.MONTH,r)).getDate()))),u!=Ht.week||(s=a.getDay()),a[u[1]](a[u[0]]()+r),!s||a.setDate(a.getDate()+s))}return a}function x(e,t){return+this>=+e&&+t>=+this}function T(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}function L(){return new t(this.getTime())}function F(){var e=t.locale;return e.setLeapYear(this),e.day_count.slice(0,this.getMonth()).reduce(o,0)+this.getDate()-1}function H(){return new t(this.getFullYear(),this.getMonth(),1)}function E(e){var t=this.getTimezoneOffset();return[t>0?"-":"+",a(Math.floor(Math.abs(t)/60),2),e?":":"",a(Math.abs(t%60),2)].join("")}function I(){return this.getDay()||7}function A(){return Math.ceil((C.call(new t(this.getFullYear()+1,0,1))-C.call(this))/ft)}function C(){var e=this.getFullYear();return new t(e,0,lt[new t(e,0,1).getDay()])}function z(){var e,n=this.getFullYear();return this>=C.call(new t(n+1,0,1))?1:(e=Math.floor((F.call(this)-I.call(this)+10)/7),0==e?R.call(new t(n-1,0,1))-j(this):e)}function R(){return Math.round((C.call(new t(this.getFullYear()+1,0,1))-C.call(this))/pt)}function U(){var e=t.locale,n=this.getMonth();return e.setLeapYear(this),new t(this.getFullYear(),n,e.day_count[n])}function W(){return Math.floor(F.call(this)/7)}function Z(){return new t(this.getFullYear(),0,1).getTimezoneOffset()!=this.getTimezoneOffset()}function P(){return t.locale.isLeapYear(this.getFullYear())}function G(e){return this.setMonth(0),this.setDate(1),this.adjust(t.DAY,7*e).getTime()}function K(){var e=this.toString().split(" ");return e.splice(4,e.length).join(" ").replace($t,"$1").replace(Bt,"")}function q(t){return e.ntype(t)=="date"&&!isNaN(+t)}function V(e){var n,r,i,u,s,a,o=t.locale.id;if(It[o][e])return It[o][e];for(n=[" var out=[];"],s=e.replace(Zt,Lt).replace(Wt,Ft).split(Vt),a=/^[^A-Za-z]*$/g,r=-1,i=s.length;++r<i;)u=s[r],u==Tt?(n.push(J(s[++r])),++r):a.test(u)?n.push(J(u)):n.push(B(u));return n.push('return out.join( "" );\n //@ sourceURL=d8/format/'+o+"/"+e),It[o][e]=new Function("filter","date",n.join("\n\n "))}function $(e){return V(e)(ut,this)}function B(e){return e.replace(ct,function(e,t,n,r){return J(t+"', filter."+n+"( date ), '"+r)})}function J(e){return"out.push( '"+e+"' );"}function Q(e,n){q(e)||(q(new t(e))?e=new t(e):(n=e,e=t.now()));var r=t.locale.lexicon;return typeof zt[n=String(n).toLowerCase()]!="function"&&(n=r.DEFAULT),+e-+this?zt[n].call(r,this,e).replace(qt," "):r.just_now}function X(e){return e.join(" ")}function et(e,t){var n=e.pop();return(e.length?e.join(this.delim)+" "+this.and+" "+n:n)+" "+this[t.tense<1?"ago":"from_now"]}function tt(n){switch(e.ntype(n)){case"object":if(n.id){Rt[n.id]=n;break}case"string":if(n in Rt){n=Rt[n];break}default:n=null}return e.ntype(n)=="object"&&(e.defs(t,{locale:{value:n},getOrdinal:n.getOrdinal,isLeapYear:n.isLeapYear,setLeapYear:n.setLeapYear},"w",!0),n.id in It||(It[n.id]=e.obj()),n.id in At||(At[n.id]=e.obj()),ut=nt(n),at=rt(n),ot=it(n)),t}function nt(n){var u={d:function(e){return a(e.getDate(),2)},D:function(e){return n.days[e.getDay()].substring(0,3)},j:function(e){return e.getDate()},l:function(e){return n.days[e.getDay()]},N:function(e){return I.call(e)},S:function(e){return n.getOrdinal(e.getDate())},w:function(e){return e.getDay()},z:function(e){return e.getDayOfYear()},W:function(e){return z.call(e)},F:function(e){return n.months[e.getMonth()]},m:function(e){return a(e.getMonth()+1,2)},M:function(e){return n.months[e.getMonth()].substring(0,3)},n:function(e){return e.getMonth()+1},t:function(e){return n.setLeapYear(e),n.day_count[e.getMonth()]},L:function(e){return e.isLeapYear()?1:0},o:function(e){var t=e.getMonth(),n=z.call(e);return e.getFullYear()+(1==n&&t>0?1:n>=52&&11>t?-1:0)},Y:function(e){return e.getFullYear()},y:function(e){return String(e.getFullYear()).substring(2,4)},a:function(e){return r(e.getHours()<12?n.AM:n.PM)},A:function(e){return i(e.getHours()<12?n.AM:n.PM)},g:function(e){return e.getHours()%12||12},G:function(e){return e.getHours()},h:function(e){return a(ut.g(e),2)},H:function(e){return a(ut.G(e),2)},i:function(e){return a(e.getMinutes(),2)},s:function(e){return a(e.getSeconds(),2)},u:function(e){return a(e.getMilliseconds(),3)},O:function(e){return E.call(e)},P:function(e){return E.call(e,!0)},T:function(e){return K.call(e)},Z:function(e){return e.getTimezoneOffset()*-60},c:function(e){return $.call(e,at.ISO_8601)},r:function(e){return $.call(e,at.RFC_2822)},U:function(e){return e.getTime()},e:function(e){return e.lexicalize("exact")},x:function(e){return e.lexicalize("approx")}};return st=Object.keys(u).sort().join(""),ct=new RegExp("([^"+st+"]*)(["+st+"])([^"+st+"]*)","g"),e.def(t,"filters",{value:ut=u},"w",!0),u}function rt(n){var r=e.copy({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"},n.formats);return r.atom=r.ISO_8601,r.cookie=r.RFC_850,r.rss=r.RFC_2822,e.def(t,"formats",{value:at=r},"w",!0),r}function it(u){var s={d:{k:kt,fn:Number,re:Gt},D:{k:Mt,fn:n.bind(null,u.days_short),re:"("+u.days_short.join("|")+")"},j:{k:kt,fn:Number,re:Pt},l:{k:Mt,fn:n.bind(null,u.days),re:"("+u.days.join("|")+")"},N:{k:Mt,fn:D.bind(null,7),re:"([1-7])"},S:{re:"(?:"+u.ordinal.join("|")+")"},w:{k:Mt,fn:Number,re:"([0-6])"},z:{k:yt,fn:Number,re:"([0-9]{1,3})"},W:{k:St,fn:Number,re:Gt},F:{k:Ot,fn:n.bind(null,u.months),re:"("+u.months.join("|")+")"},m:{k:Ot,fn:D,re:Gt},M:{k:Ot,fn:n.bind(null,u.months_short),re:"("+u.months_short.join("|")+")"},n:{k:Ot,fn:D,re:Pt},t:{re:"[0-9]{2}"},L:{re:"(?:0|1)"},o:{k:xt,fn:Number,re:Kt},Y:{k:xt,fn:Number,re:Kt},y:{k:xt,fn:function(e){return e=Number(e),e+=30>e?2e3:1900},re:Gt},a:{k:_t,fn:e,re:Ut},A:{k:_t,fn:r,re:i(Ut)},g:{k:vt,fn:v,re:Pt},G:{k:vt,fn:Number,re:Pt},h:{k:vt,fn:v,re:Gt},H:{k:vt,fn:Number,re:Gt},i:{k:Nt,fn:Number,re:Gt},s:{k:Yt,fn:Number,re:Gt},u:{k:wt,fn:Number,re:"([0-9]{1,})"},O:{k:jt,fn:Y,re:"([\\+-][0-9]{4})"},P:{k:jt,fn:Y,re:"([\\+-][0-9]{2}:[0-9]{2})"},T:{re:"[A-Z]{1,4}"},Z:{k:jt,fn:Y,re:"(Z|[\\+-]?[0-9]{2}:?[0-9]{2})"},U:{k:Dt,fn:Number,re:"(-?[0-9]{1,})"}};return s.c={combo:[s.Y,s.m,s.d,s.H,s.i,s.s,s.u,s.P],re:[s.Y.re,"-",s.m.re,"-",s.d.re,"T",s.H.re,":",s.i.re,":",s.s.re,"(?:\\.",s.u.re,"){0,1}",s.Z.re,"{0,1}"].join("")},s.r={combo:[s.D,s.d,s.M,s.Y,s.H,s.i,s.s,s.O],re:[s.D.re,", ",s.d.re," ",s.M.re," ",s.Y.re," ",s.H.re,":",s.i.re,":",s.s.re," ",s.O.re].join("")},e.def(t,"parsers",{value:ot=s},"w",!0),s}var ut,st,at,ot,ct,lt=[9,1,0,-1,-2,4,3],ft=864e5,ht=36e5,gt=6e4,mt=2592e6,dt=1e3,pt=6048e5,bt=31536e6,_t="ampm",kt="day",Mt="dayweek",yt="dayyear",vt="hour",wt="ms",Nt="minute",Ot="month",Yt="second",jt="timezone",Dt="unix",St="week",xt="year",Tt="NOREPLACE",Lt="<"+Tt+"<",Ft=">END"+Tt+">",Ht={day:["getDate","setDate"],hr:["getHours","setHours"],min:["getMinutes","setMinutes"],month:["getMonth","setMonth"],ms:["getMilliseconds","setMilliseconds"],sec:["getSeconds","setSeconds"],week:["getWeek","setWeek"],year:["getFullYear","setFullYear"]},Et=[xt,Ot,St,kt,"hr",Nt.substring(0,3),Yt.substring(0,3),wt],It=e.obj(),At=e.obj(),Ct=[kt,Mt,yt,Ot,St,xt],zt=e.obj(),Rt=e.obj(),Ut="(am|pm)",Wt=/>/g,Zt=/</g,Pt="([0-9]{1,2})",Gt="([0-9]{2})",Kt="([0-9]{4})",qt=/\s{2,}/g,Vt=/[<>]/,$t=/[^\(]*\(([^\)]+)\)/g,Bt=/[^A-Z]+/g,Jt=/[\+-]?([0-9]{2}):?([0-9]{2})/,Qt=[[xt+"s",bt],[Ot+"s",mt],[St+"s",pt],[kt+"s",ft],[vt+"s",ht],[Nt+"s",gt],[Yt+"s",dt],[wt,1]],Xt=Qt.pluck(0);zt.approx=function(e,n){var r,i,u,s,a,o,c,l=this.a,f=e.diff(n),h=t.diffKeys(f),g=t.time_map,m=this.time_units;if(f.value<t.MS_MINUTE)return this.just_now;switch(h[0]){case"years":u=0;break;case"months":u=1;break;case"weeks":u=2;break;case"days":f.days<2&&(o=e.format("l")===n.format("l"),c=o||h[1]!="hours"||f.hours<25),u=3;break;case"hours":o=e.format("l")===n.format("l"),c=f.hours/24>=.75,l=this.an,u=4;break;case"minutes":u=5}if(i=(f.value-g[u][1]*f[h[0]])/g[u][1],c)return o?this.today:f.tense>0?this.tomorrow:this.yesterday;if(s=[],a=f.tense>0?this.from_now:this.ago,.1>i)switch(h[0]){case"years":case"months":case"weeks":if(f[h[0]]===1){s.push(f.tense<1?this.last:this.next,m[u][0]);break}default:!i||s.push(this.about),s.push(f[h[0]],m[u][f[h[0]]>1?1:0],a)}else.74>i?.24>i?r=this.just_over:(r=i>.24&&.4>i?this.almost:this.about,s.push(this.and,this.a,this.half)):s.push(this.almost,f[h[0]]+1,m[u][1],a);return r&&(s.push(m[u][f[h[0]]>1||s.length?1:0],a),s.unshift(r,f[h[0]])),typeof this.approx=="function"?this.approx.call(this,s,f):X.call(this,s,f)},zt.exact=function(e,n){var r,i=e.diff(n),u=this.time_units;return r=t.time_map.reduce(function(e,t,n){var r=i[t[0]];return!r||!u[n]||e.push(r+" "+u[n][r>1?1:0]),e},[]),r.length?typeof this.exact=="function"?this.exact.call(this,r,i):et.call(this,r,i):this.just_now},e.defs(t.prototype,{adjust:S,between:x,clearTime:T,clone:L,diff:d,format:$,getDayOfYear:F,getFirstOfTheMonth:H,getGMTOffset:E,getISODay:I,getISODaysInYear:A,getISOFirstMondayOfYear:C,getISOWeek:z,getISOWeeksInYear:R,getLastOfTheMonth:U,getWeek:W,isDST:Z,isLeapYear:P,lexicalize:Q,setWeek:G,timezone:K,valid:function(){return t.valid(this)}},"r"),e.defs(t,{DAY:kt,HOUR:"hr",MINUTE:Nt.substring(0,3),MILLISECOND:wt,MONTH:Ot,SECOND:Yt.substring(0,3),WEEK:St,YEAR:xt,MS_DAY:ft,MS_HOUR:ht,MS_MINUTE:gt,MS_MONTH:mt,MS_SECOND:dt,MS_WEEK:pt,MS_YEAR:bt,lexicon:{value:zt},time_map:{value:Qt},time_props:{value:Xt},coerce:c,diffKeys:y,localize:tt,toDate:c,valid:q},"r")}).x(Date)}("undefined"!=typeof m8?m8:"undefined"!=typeof require?require("m8"):null);

@@ -33,3 +33,3 @@ {

},
"version" : "0.4.2"
"version" : "0.4.3"
}

@@ -55,2 +55,5 @@ function coerce( date_str, date_format ) {

// if ( date.isDST() )
// date.setHours( date.getHours() + 1 );
return date;

@@ -57,0 +60,0 @@ }

@@ -15,3 +15,7 @@ // private methods

function _dayOffset( d ) { return Math.floor( ( d - getISOFirstMondayOfYear.call( d ) ) / MS_DAY ); }
function _hours( d ) { return d.getHours() + ( d.isDST() ? 1 : 0 ); }
function _timezoneOffset( o ) {
if ( o == 'Z' ) {
o = '0000';
}
var t = !!o.indexOf( '-' ),

@@ -18,0 +22,0 @@ m = o.match( re_tz_off ),

function localize_formats( L ) {
var F = util.copy( {
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',
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'

@@ -6,0 +6,0 @@ }, L.formats );

@@ -42,3 +42,3 @@ function localize_parsers( L ) {

T : { re : '[A-Z]{1,4}' },
Z : { k : TIMEZONE, fn : Number, re : '([\\+-]?[0-9]{5})' },
Z : { k : TIMEZONE, fn : _timezoneOffset, re : '(Z|[\\+-]?[0-9]{2}:?[0-9]{2})' },
// full date/time

@@ -50,3 +50,3 @@ U : { k : UNIX, fn : Number, re : '(-?[0-9]{1,})' }

combo : [P.Y, P.m, P.d, P.H, P.i, P.s, P.u, P.P],
re : [P.Y.re, '-', P.m.re, '-', P.d.re, 'T', P.H.re, ':', P.i.re, ':', P.s.re, '(?:\\.', P.u.re, '){0,1}', P.P.re, '{0,1}'].join( '' )
re : [P.Y.re, '-', P.m.re, '-', P.d.re, 'T', P.H.re, ':', P.i.re, ':', P.s.re, '(?:\\.', P.u.re, '){0,1}', P.Z.re, '{0,1}'].join( '' )
};

@@ -53,0 +53,0 @@ P.r = {

@@ -64,3 +64,3 @@ // 481

expect( Date.getOrdinal( 23 ) ).to.eql( 'rd' );
done();

@@ -86,3 +86,3 @@ } );

expect( Date.isLeapYear( 2021 ) ).to.be.false;
done();

@@ -127,2 +127,7 @@ } );

expect( Date.coerce( '2010-08-30T10:10:10.010+0000', 'c' ) ).to.eql( new Date( 2010, 7, 30, ( 10 + offset ), 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010+0000', 'c' ) ).to.eql( new Date( 2010, 7, 30, 10 + offset, 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010+0400', 'c' ) ).to.eql( new Date( 2010, 7, 30, 6 + offset, 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010-0800', 'c' ) ).to.eql( new Date( 2010, 7, 30, 18 + offset, 10, 10, 10 ) );
done();

@@ -195,3 +200,3 @@ } );

expect( new Date( 2010, 0, 1, 1, 10, 10, 10 ).between( new Date( 2009, 4, 1 ), new Date( 2010, 0, 1, 1, 10, 10, 9 ) ) ).to.be.false;
done();

@@ -202,6 +207,6 @@ } );

var e = new Date( 2010, 0, 1 ), r = new Date( 2010, 0, 1, 1, 10, 10, 10 );
expect( r ).not.to.eql( e );
expect( r.clone().clearTime() ).to.eql( e );
done();

@@ -212,6 +217,6 @@ } );

var e = new Date( 2010, 0, 1 ), r = e.clone();
expect( r ).not.to.equal( e );
expect( r ).to.eql( e );
done();

@@ -401,3 +406,3 @@ } );

expect( ( new Date( 2012, 0, 1 ) ).adjust( Date.SECOND, 60 ).lexicalize( new Date( 2012, 0, 1 ), 'exact' ) ).to.equal( '1 minute from now' );
expect( ( new Date( 2012, 0, 1 ) ).adjust( { year : -1, month : -1, week : -1, day : -1, hr : -1, min : -1, sec : -1 } ).lexicalize( new Date( 2012, 0, 1 ), 'exact' ) ).to.equal( '1 year, 1 month, 1 week, 4 days, 1 hour and 1 minute ago' );

@@ -432,3 +437,3 @@ expect( ( new Date( 2012, 0, 1 ) ).adjust( { year : 1, month : 1, week : 1, day : 1, hr : 1, min : 1, sec : 1 } ).lexicalize( new Date( 2012, 0, 1 ), 'exact' ) ).to.equal( '1 year, 1 month, 1 week, 5 days, 1 hour, 1 minute and 1 second from now' );

expect( ( new Date( 2012, 0, 1 ) ).adjust( Date.WEEK, 7 ).lexicalize( new Date( 2012, 0, 1 ), 'approx' ) ).to.equal( 'about 1 and a half months from now' );
expect( ( new Date( 2012, 0, 1 ) ).adjust( Date.DAY, -1 ).lexicalize( new Date( 2012, 0, 1 ), 'approx' ) ).to.equal( 'yesterday' );

@@ -516,3 +521,3 @@ expect( ( new Date( 2012, 0, 1, 12 ) ).adjust( Date.HOUR, -18 ).lexicalize( new Date( 2012, 0, 1, 12 ), 'approx' ) ).to.equal( 'yesterday' );

var fn = 'getGMTOffset';
expect( call( fn, new MockDate( { tzo : 0 } ) ) ).to.eql( '+0000' );

@@ -528,3 +533,3 @@ expect( call( fn, new MockDate( { tzo : -60 } ) ) ).to.eql( '+0100' );

expect( call( fn, new MockDate( { tzo : 600 } ), true ) ).to.eql( '-10:00' );
done();

@@ -541,3 +546,3 @@ } );

expect( new Date( 2007, 0, 6 ).getISODay() ).to.eql( 6 );
done();

@@ -548,3 +553,3 @@ } );

var r = [364, 364, 364, 364, 371, 371, 357, 364, 364, 371, 364];
[2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010].forEach( function( y, i ) {

@@ -563,3 +568,3 @@ expect( new Date( y, 1, 1 ).getISODaysInYear() ).to.eql( r[i] );

} );
done();

@@ -580,3 +585,3 @@ } );

} );
done();

@@ -591,3 +596,3 @@ } );

} );
done();

@@ -635,3 +640,3 @@ } );

expect( new Date( 2100, 0, 1 ).isLeapYear() ).to.be.false;
done();

@@ -638,0 +643,0 @@ } );

@@ -122,2 +122,7 @@ // 481

expect( Date.coerce( '2010-08-30T10:10:10.010+0000', 'c' ) ).to.eql( new Date( 2010, 7, 30, ( 10 + offset ), 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010+0000', 'c' ) ).to.eql( new Date( 2010, 7, 30, 10 + offset, 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010+0400', 'c' ) ).to.eql( new Date( 2010, 7, 30, 6 + offset, 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010-0800', 'c' ) ).to.eql( new Date( 2010, 7, 30, 18 + offset, 10, 10, 10 ) );
done();

@@ -124,0 +129,0 @@ } );

@@ -121,2 +121,7 @@ typeof m8 !== 'undefined' || ( m8 = require( 'm8' ) );

expect( Date.coerce( '2010-08-30T10:10:10.010+0000', 'c' ) ).to.eql( new Date( 2010, 7, 30, ( 10 + offset ), 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010+0000', 'c' ) ).to.eql( new Date( 2010, 7, 30, 10 + offset, 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010+0400', 'c' ) ).to.eql( new Date( 2010, 7, 30, 6 + offset, 10, 10, 10 ) );
expect( Date.coerce( '2010-08-30T10:10:10.010-0800', 'c' ) ).to.eql( new Date( 2010, 7, 30, 18 + offset, 10, 10, 10 ) );
done();

@@ -123,0 +128,0 @@ } );

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