# All files calendardates.cjs.js

98.46% Statements 64/65
83.33% Branches 20/24
100% Functions 28/28
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2756x
     "use strict";function t(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n="previous",e="current",r="next",u=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";return t<10?n+t:t},a=function(t){return"".concat(t.getFullYear(),"-").concat(u(t.getMonth()+1),"-").concat(u(t.getDate()))},o=function(t){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()},i=function(t){return new Promise((function(u){var a=[],o=l(t).map((function(t){return{date:t.date,iso:t.iso,type:n}})),i=f(t).map((function(t){return{date:t.date,iso:t.iso,type:e}}));a=a.concat(o).concat(i);var c=s(t,a.length).map((function(t){return{date:t.date,iso:t.iso,type:r}}));u(a.concat(c))}))},c=function(t){return function(n){return Array(t).fill().map(n)}},f=function(t){var n=o(t);return c(n)((function(n,e){var r=e+1;return t.setDate(r),{date:r,iso:a(t)}}))},l=function(t){var n,e,r=t.getMonth(),u=t.getFullYear(),i=Math.min(r-1,11),f=new Date(u,i),l=o(f),s=l-(n=t,e=new Date(n.getFullYear(),n.getMonth(),1).toDateString().substring(0,3),["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(e))+1;return c(l-s+1)((function(t,n){var e=s+n;return f.setDate(e),{date:e,iso:a(f)}}))},s=function(t,n){var e=42-n,r=t.getMonth()+1===12?0:t.getMonth()+1,u=0===r?t.getFullYear()+1:t.getFullYear(),o=new Date(u,r);return c(e)((function(t,n){var e=n+1;return o.setDate(e),{date:e,iso:a(o)}}))},g=function(){function n(){!function(t,n){Iif(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,n)}var e,r,u;return e=n,(r=[{key:"getDates",value:function(t){return new Promise((function(n){return n(i(t).then((function(t){return t.map((function(t){return t}))})))}))}},{key:"getMatrix",value:function(t){return new Promise((function(n){n(i(t).then((function(t){return t.reduce((function(t,n,e){return(e%7==0?t.push([n]):t[t.length-1].push(n))&&t}),[])})))}))}}])&&t(e.prototype,r),u&&t(e,u),n}();module.exports=g;