UNPKG

iking-utils-pro

Version:

金合前端工具库

2 lines (1 loc) 17.7 kB
import b from"dayjs";const e={lunarInfo:[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416,22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42416,83315,21168,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46752,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208,53856,60005,54576,23200,30371,38608,19195,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448,84835,37744,18936,18800,25776,92326,59984,27424,108228,43744,41696,53987,51552,54615,54432,55888,23893,22176,42704,21972,21200,43448,43344,46240,46758,44368,21920,43940,42416,21168,45683,26928,29495,27296,44368,84821,19296,42352,21732,53600,59752,54560,55968,92838,22224,19168,43476,41680,53584,62034,54560],solarMonth:[31,28,31,30,31,30,31,31,30,31,30,31],Gan:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],Zhi:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],Animals:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],solarTerm:["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"],sTermInfo:["9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd0b06bdb0722c965ce1cfcc920f","b027097bd097c36b0b6fc9274c91aa","9778397bd19801ec9210c965cc920e","97b6b97bd19801ec95f8c965cc920f","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd197c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bd09801d98082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec95f8c965cc920e","97bcf97c3598082c95f8e1cfcc920f","97bd097bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c3598082c95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf97c359801ec95f8c965cc920f","97bd097bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd19801ec9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b97bd19801ec95f8c965cc920f","97bd07f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c91aa","97b6b97bd19801ec9210c965cc920e","97bd07f1487f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c965cc920e","97bcf7f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b97bd19801ec9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b97bd197c36c9210c9274c920e","97bcf7f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","9778397bd097c36c9210c9274c920e","97b6b7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c36b0b6fc9210c8dc2","9778397bd097c36b0b70c9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9274c91aa","97b6b7f0e47f531b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c91aa","97b6b7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","9778397bd097c36b0b6fc9210c8dc2","977837f0e37f149b0723b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f5307f595b0b0bc920fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f595b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc9210c8dc2","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd097c35b0b6fc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0b0bb0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14998082b0723b06bd","7f07e7f0e37f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e397bd07f595b0b0bc920fb0722","977837f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f595b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e37f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f1487f531b0b0bb0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e47f149b0723b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14998082b0723b06bd","7f07e7f0e37f14998083b0787b0721","7f0e27f0e47f531b0723b0b6fb0722","7f0e37f0e366aa89801eb072297c35","7ec967f0e37f14898082b0723b02d5","7f07e7f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66aa89801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b0721","7f07e7f0e47f531b0723b0b6fb0722","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b0723b02d5","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e36665b66a449801e9808297c35","665f67f0e37f14898082b072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e26665b66a449801e9808297c35","665f67f0e37f1489801eb072297c35","7ec967f0e37f14998082b0787b06bd","7f07e7f0e47f531b0723b0b6fb0721","7f0e27f1487f531b0b0bb0b6fb0722"],nStr1:["日","一","二","三","四","五","六","七","八","九","十"],nStr2:["初","十","廿","卅"],nStr3:["正","二","三","四","五","六","七","八","九","十","冬","腊"],lunarFestival:[{month:"正",day:"初一",name:"春节"},{month:"正",day:"十五",name:"元宵节"},{month:"二",day:"初二",name:"龙抬头"},{month:"五",day:"初五",name:"端午节"},{month:"七",day:"初七",name:"七夕节"},{month:"七",day:"十五",name:"中元节"},{month:"八",day:"十五",name:"中秋节"},{month:"九",day:"初九",name:"重阳节"},{month:"腊",day:"除夕",name:"除夕"}],solarFestival:[{month:1,day:1,name:"元旦节"},{month:3,day:8,name:"妇女节"},{month:3,day:12,name:"植树节"},{month:4,day:5,name:"清明节"},{month:5,day:1,name:"劳动节"},{month:5,day:4,name:"青年节"},{month:6,day:1,name:"儿童节"},{month:7,day:1,name:"建党节"},{month:8,day:1,name:"建军节"},{month:9,day:10,name:"教师节"},{month:10,day:1,name:"国庆节"}],lYearDays:function(b){var f,t=348;for(f=32768;f>8;f>>=1)t+=e.lunarInfo[b-1900]&f?1:0;return t+e.leapDays(b)},leapMonth:function(b){return 15&e.lunarInfo[b-1900]},leapDays:function(b){return e.leapMonth(b)?65536&e.lunarInfo[b-1900]?30:29:0},monthDays:function(b,f){return f>12||f<1?-1:e.lunarInfo[b-1900]&65536>>f?30:29},solarDays:function(b,f){if(f>12||f<1)return-1;var t=f-1;return 1==t?b%4==0&&b%100!=0||b%400==0?29:28:e.solarMonth[t]},toGanZhiYear:function(b){var f=(b-3)%10,t=(b-3)%12;return 0==f&&(f=10),0==t&&(t=12),e.Gan[f-1]+e.Zhi[t-1]},toAstro:function(b,e){return"魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯".substr(2*b-(e<[20,19,21,21,21,22,23,23,23,23,22,22][b-1]?2:0),2)+"座"},toGanZhi:function(b){return e.Gan[b%10]+e.Zhi[b%12]},getTerm:function(b,f){if(b<1900||b>2100)return-1;if(f<1||f>24)return-1;var t=e.sTermInfo[b-1900],c=[parseInt("0x"+t.substr(0,5)).toString(),parseInt("0x"+t.substr(5,5)).toString(),parseInt("0x"+t.substr(10,5)).toString(),parseInt("0x"+t.substr(15,5)).toString(),parseInt("0x"+t.substr(20,5)).toString(),parseInt("0x"+t.substr(25,5)).toString()],a=[c[0].substr(0,1),c[0].substr(1,2),c[0].substr(3,1),c[0].substr(4,2),c[1].substr(0,1),c[1].substr(1,2),c[1].substr(3,1),c[1].substr(4,2),c[2].substr(0,1),c[2].substr(1,2),c[2].substr(3,1),c[2].substr(4,2),c[3].substr(0,1),c[3].substr(1,2),c[3].substr(3,1),c[3].substr(4,2),c[4].substr(0,1),c[4].substr(1,2),c[4].substr(3,1),c[4].substr(4,2),c[5].substr(0,1),c[5].substr(1,2),c[5].substr(3,1),c[5].substr(4,2)];return parseInt(a[f-1])},toChinaMonth:function(b){if(b>12||b<1)return-1;var f=e.nStr3[b-1];return f+="月"},toChinaDay:function(b){var f;switch(b){case 10:f="初十";break;case 20:f="二十";break;case 30:f="三十";break;default:f=e.nStr2[Math.floor(b/10)],f+=e.nStr1[b%10]}return f},getAnimal:function(b){return e.Animals[(b-4)%12]},getFestival:function(b,f,t){let c=null;const a=parseInt(b+"");return c=isNaN(a)?e.lunarFestival.find((e=>`${e.month}月`===b&&e.day===f)):e.solarFestival.find((b=>b.month===a&&b.day==f)),c||null},solar2lunar:function(b,f,t){if(b<1900||b>2100)return-1;if(1900==b&&1==f&&t<31)return-1;let c;c=b?new Date(b,parseInt(f+"")-1,t):new Date;let a,n=0;const r=c.getFullYear(),s=c.getMonth()+1,o=c.getDate();let d=(Date.UTC(c.getFullYear(),c.getMonth(),c.getDate())-Date.UTC(1900,0,31))/864e5;for(a=1900;a<2101&&d>0;a++)n=e.lYearDays(a),d-=n;d<0&&(d+=n,a--);const i=new Date;let u=!1;i.getFullYear()==r&&i.getMonth()+1==s&&i.getDate()==o&&(u=!0);let l=c.getDay(),m=e.nStr1[l];0==l&&(l=7);const D=a;let h=e.leapMonth(a),y=!1;for(a=1;a<13&&d>0;a++)h>0&&a==h+1&&0==y?(--a,y=!0,n=e.leapDays(D)):n=e.monthDays(D,a),1==y&&a==h+1&&(y=!1),d-=n;0==d&&h>0&&a==h+1&&(y?y=!1:(y=!0,--a)),d<0&&(d+=n,--a);const g=a,w=d+1,Y=s-1,M=e.toGanZhiYear(D),p=e.getTerm(D,2*s-1),k=e.getTerm(D,2*s);let T=e.toGanZhi(12*(r-1900)+s+11);o>=p&&(T=e.toGanZhi(12*(r-1900)+s+12));let v=!1,S=null;p==o&&(v=!0,S=e.solarTerm[2*s-2]),k==o&&(v=!0,S=e.solarTerm[2*s-1]);const I=Date.UTC(r,Y,1,0,0,0,0)/864e5+25567+10,C=e.toGanZhi(I+o-1),N=e.toAstro(s,o),F=e.toChinaMonth(g),U=e.toChinaDay(w);return{lYear:D,lMonth:g,lDay:w,Animal:e.getAnimal(D),IMonthCn:(y?"闰":"")+F,IDayCn:U,cYear:r,cMonth:s,cDay:o,gzYear:M,gzMonth:T,gzDay:C,isToday:u,isLeap:y,nWeek:l,ncWeek:"星期"+m,isTerm:v,Term:S,astro:N,festcn:e.getFestival(F,U,r),fest:e.getFestival(s,o,r)}},lunar2solar:function(b,f,t,c=!1){const a=!!c,n=e.leapMonth(b);if(e.leapDays(b),a&&n!=f)return-1;if(2100==b&&12==f&&t>1||1900==b&&1==f&&t<31)return-1;const r=e.monthDays(b,f);let s=r;if(a&&(s=e.leapDays(b)),b<1900||b>2100||t>s)return-1;let o=0;for(let f=1900;f<b;f++)o+=e.lYearDays(f);let d=0,i=!1;for(let t=1;t<f;t++)d=e.leapMonth(b),i||d<=t&&d>0&&(o+=e.leapDays(b),i=!0),o+=e.monthDays(b,t);a&&(o+=r);const u=Date.UTC(1900,1,30,0,0,0),l=new Date(864e5*(o+t-31)+u),m=l.getUTCFullYear(),D=l.getUTCMonth()+1,h=l.getUTCDate();return e.solar2lunar(m,D,h)}},f=e.lunar2solar,t=(b,e=!0)=>{b=b||new Date;const f=new Date(b).getDay(),t={0:"日",1:"一",2:"二",3:"三",4:"四",5:"五",6:"六"}[f];return e?[t,`星期${t}`,`周${t}`,f]:t},c=["number","string"],a=(b,e)=>(c.includes(typeof b)&&c.includes(typeof e)||(b=(new Date).getFullYear(),e=(new Date).getMonth()+1),new Date(b,e,0).getDate()),n=864e5,r=e=>{e=e||new Date;const f=[],c=new Date(e).getDay()||7,a=new Date(e).getTime();let r=1,s=1;for(;c>=r;){let e=a-(c-r)*n;const s=t(e);f.push({date:b(e).format("YYYY-MM-DD"),datemon:b(e).format("MM-DD"),week:s[0],week1:s[1],week2:s[2],week3:s[3]}),r++}for(;s<=7-c;){let e=a+s*n;const c=t(e);f.push({date:b(e).format("YYYY-MM-DD"),datemon:b(e).format("MM-DD"),week:c[0],week1:c[1],week2:c[2],week3:c[3]}),s++}return f},s=e=>{const f=[],c=b(e).format("YYYY"),n=b(e).format("MM"),r=a(Number.parseInt(c),Number.parseInt(n));let s=1;for(;s<=r;){const e=`${n}-${("00"+s).substr(`${s}`.length)}`,a=`${c}-${e}`,r=t(a);f.push({date:a,datemon:e,dateday:b(a).format("DD"),week:r[0],week1:r[1],week2:r[2],week3:r[3],isnow:!0}),s++}return f},o=f=>{const c=s(f),a=c[0].week3;let r=1;for(;r<a;){const e=new Date(c[0].date).getTime()-n,f=t(e);c.unshift({date:b(e).format("YYYY-MM-DD"),datemon:b(e).format("MM-DD"),dateday:b(e).format("DD"),week:f[0],week1:f[1],week2:f[2],week3:f[3],isback:!0}),r++}let o=c.length;for(;o<42;){const e=new Date(c[o-1].date).getTime()+n,f=t(e);c.push({date:b(e).format("YYYY-MM-DD"),datemon:b(e).format("MM-DD"),dateday:b(e).format("DD"),week:f[0],week1:f[1],week2:f[2],week3:f[3],isnext:!0}),o++}return c.forEach((b=>{const f=b.date.split("-"),t=e.solar2lunar(f[0],f[1],f[2]);b.nl=t,"number"!=typeof t&&(b.monthcn=t.IMonthCn,b.daycn=t.IDayCn)})),c};function d(b,e){return Object.prototype.toString.call(b)===`[object ${e}]`}function i(b){return Object.prototype.toString.call(b)}class u{static isJSON(b){try{return!!JSON.parse(b)}catch(b){return!1}}static getTypeLong(b){return i(b)}static getType(b){const e=i(b);return e.substring(8,e.length-1).toLocaleLowerCase()}static isDef(b){return void 0!==b}static isUnDef(b){return!this.isDef(b)}static isObject(b){return null!==b&&d(b,"Object")}static isEmpty(b){return this.isArray(b)||this.isString(b)?0===b.length:b instanceof Map||b instanceof Set?0===b.size:!!this.isObject(b)&&0===Object.keys(b).length}static isDate(b){return d(b,"Date")}static isNull(b){return null===b}static isNullAndUnDef(b){return this.isUnDef(b)&&this.isNull(b)}static isNullOrUnDef(b){return this.isUnDef(b)||this.isNull(b)}static isNumber(b){return d(b,"Number")}static isPromise(b){return d(b,"Promise")&&this.isObject(b)&&this.isFunction(b.then)&&this.isFunction(b.catch)}static isString(b){return d(b,"String")}static isFunction(b){return"function"==typeof b}static isBoolean(b){return d(b,"Boolean")}static isRegExp(b){return d(b,"RegExp")}static isArray(b){return b&&Array.isArray(b)}static isWindow(b){return"undefined"!=typeof window&&d(b,"Window")}static isElement(b){return this.isObject(b)&&!!b.tagName}static isMap(b){return d(b,"Map")}static isServer="undefined"==typeof window;static isClient=!this.isServer;static isUrl(b){return/(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(b)}}const l=(b,e)=>{if(u.isNullOrUnDef(b)||u.isNullOrUnDef(e))throw new TypeError("params must both be not empty or null or undefined");let f=null;return f=u.isDate(b)&&u.isDate(e)?Math.abs(b.getTime()-e.getTime()):Math.abs(new Date(b).getTime()-new Date(e).getTime()),Math.floor(f/864e5)},m=(e,f,t)=>{const c=new Date(e),a=new Date(f),n=[];let r=c;for(;r<=a;)n.push(b(new Date(r)).format(t)),r.setDate(r.getDate()+1);return n};function D(e=void 0,f="YYYY-MM-DD HH:mm:ss"){return b(e).format(f)}function h(e=void 0,f="YYYY-MM-DD"){return b(e).format(f)}function y(e=void 0,f="YYYY"){return b(e).format(f)}function g(e=void 0,f="YYYY-MM"){return b(e).format(f)}function w(e=void 0,f="MM-DD"){return b(e).format(f)}function Y(e=void 0,f="YYYY-MM-DD"){return b(e).format(f)}function M(e=void 0,f="YYYY-MM-DD HH:mm"){return b(e).format(f)}export{e as convertDate,f as dayDetail,l as daysBetweenDates,t as formatWeek,m as getDatesBetween,s as getMonth,o as getMonthComple,a as getMonthDay,r as getWeek,h as toDate,D as toDateTime,w as toMD,y as toY,g as toYM,Y as toYMD,M as toYMDHM};