pin-diary-6/template
code:mod.ts
function n(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function a(e){n(1,arguments);let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="object Date"?new Date(e.getTime()):typeof e=="number"||t==="object Number"?new Date(e):((typeof e=="string"||t==="object String")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use parseISO to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function q(e){n(1,arguments);let r=a(e).getFullYear();return r%400==0||r%4==0&&r%100!=0}function y(e){n(1,arguments);let t=a(e);return String(new Date(t))==="Invalid Date"?NaN:q(t)?366:365}function I(e){n(1,arguments);let t=a(e),r=new Date(0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function D(e){let t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function h(e){n(1,arguments);let t=a(e);return t.setHours(0,0,0,0),t}var $=864e5;function M(e,t){n(2,arguments);let r=h(e),o=h(t),i=r.getTime()-D(r),d=o.getTime()-D(o);return Math.round((i-d)/$)}function O(e){n(1,arguments);let t=a(e);return M(t,I(t))+1}function s(e){if(e===null||e===!0||e===!1)return NaN;let t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function x(e,t){n(2,arguments);let r=a(e),o=s(t);return isNaN(o)?new Date(NaN):(o&&r.setDate(r.getDate()+o),r)}function k(e,t){n(2,arguments);let r=s(t);return x(e,-r)}function p(e,t){n(1,arguments);let r=t||{},o=r.locale,i=o&&o.options&&o.options.weekStartsOn,d=i==null?0:s(i),f=r.weekStartsOn==null?d:s(r.weekStartsOn);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");let u=a(e),m=u.getDay(),l=(m<f?7:0)+m-f;return u.setDate(u.getDate()-l),u.setHours(0,0,0,0),u}function w(e,t){n(1,arguments);let r=a(e),o=r.getFullYear(),i=t?.locale?.options?.firstWeekContainsDate,d=i==null?1:s(i),f=t?.firstWeekContainsDate==null?d:s(t.firstWeekContainsDate);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");let u=new Date(0);u.setFullYear(o+1,0,f),u.setHours(0,0,0,0);let m=p(u,t),l=new Date(0);l.setFullYear(o,0,f),l.setHours(0,0,0,0);let j=p(l,t);return r.getTime()>=m.getTime()?o+1:r.getTime()>=j.getTime()?o:o-1}function C(e,t){n(1,arguments);var r=t||{},o=r.locale,i=o&&o.options&&o.options.firstWeekContainsDate,d=i==null?1:s(i),f=r.firstWeekContainsDate==null?d:s(r.firstWeekContainsDate),u=w(e,t),m=new Date(0);m.setFullYear(u,0,f),m.setHours(0,0,0,0);var l=p(m,t);return l}var U=6048e5;function Y(e,t){n(1,arguments);let r=a(e),o=p(r,t).getTime()-C(r,t).getTime();return Math.round(o/U)+1}function T(e,t){n(2,arguments);let r=a(e),o=s(t);if(isNaN(o))return new Date(NaN);if(!o)return r;let i=r.getDate(),d=new Date(r.getTime());d.setMonth(r.getMonth()+o+1,0);let f=d.getDate();return i>=f?d:(r.setFullYear(d.getFullYear(),d.getMonth(),i),r)}function S(e,t){n(2,arguments);let r=s(t);return T(e,r*12)}function A(e,t){n(2,arguments);let r=s(t);return S(e,-r)}function _(e){return n(1,arguments),a(e).getDay()}function W(e){return n(1,arguments),a(e).getFullYear()}function g(e,t){for(var r=e<0?"-":"",o=Math.abs(e).toString();o.length<t;)o="0"+o;return r+o}var H={y(e,t){let r=e.getUTCFullYear(),o=r>0?r:1-r;return g(t==="yy"?o%100:o,t.length)},M(e,t){let r=e.getUTCMonth();return t==="M"?String(r+1):g(r+1,2)},d(e,t){return g(e.getUTCDate(),t.length)},a(e,t){let r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r0;case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return g(e.getUTCHours()%12||12,t.length)},H(e,t){return g(e.getUTCHours(),t.length)},m(e,t){return g(e.getUTCMinutes(),t.length)},s(e,t){return g(e.getUTCSeconds(),t.length)},S(e,t){let r=t.length,o=e.getUTCMilliseconds(),i=Math.floor(o*Math.pow(10,r-3));return g(i,t.length)}},L=H;function F(e){n(1,arguments);var t=a(e);return!isNaN(t)}function v(e,t){n(2,arguments);let r=a(e).getTime(),o=s(t);return new Date(r+o)}function N(e,t){n(2,arguments);let r=s(t);return v(e,-r)}var R=/(\w)\1*|''|'(''|^')+('|$)|./g,z=/^'(^*?)'?$/,V=/''/g,Z=/a-zA-Z/;function c(e,t){n(2,arguments);let r=a(e);if(!F(r))throw new RangeError("Invalid time value");let o=D(r),i=N(r,o),d=t.match(R);return d?d.map(u=>{if(u==="''")return"'";let m=u0;if(m==="'")return P(u);let l=Lm;if(l)return l(i,u);if(m.match(Z))throw new RangeError("Format string contains an unescaped latin alphabet character "+m+"");return u}).join(""):""}function P(e){let t=e.match(z);return t?t1.replace(V,"'"):e}var b="yyyy/M/dd";function Zt(e){return{title:E(e),header:[第${Y(e)}週: ${K(e)},${W(e)}年 ${(O(e)*100/y(e)).toFixed(2)}%経過,"","今日のn年前", [${c(A(e,1),b)}]],footer:[[${c(k(e,1),b)}]←${c(e,b)}→[${c(x(e,1),b)}],[/ [${c(e,"yyyy/M")}.icon]]]}}function K(e){let t=_(e);return..."日月火水木金土".map((r,o)=>o===t?[[${r}]]:r).join("")}var Q=/^\d{4}\/\d{2}\/\d{2}$/;function Pt(e,t){return Q.test(e)?E(t)===e:!0}function E(e){return c(e,b)}export{Pt as filter,Zt as makeDiary};