UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

2 lines (1 loc) 589 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=["一","二","三","四","五","六","日"],u=(e,t)=>{const c=[];if(!e||!t){const s=new Date;e=s.getFullYear(),t=s.getMonth()+1}const D=new Date(e,t-1,1);let n=D.getDay();n===0&&(n=7),e=D.getFullYear(),t=D.getMonth()+1;const g=new Date(e,t-1,0).getDate(),i=n-1,f=new Date(e,t,0).getDate();for(let s=0;s<42;s++){const o=s+1-i;let l=o,a=t;o<=0?(a=t-1,l=g+o):o>f&&(a=t+1,l-=f),a===13&&(a=1),a===0&&(a=12),c.push({date:o,year:e,month:a,showDate:l})}return c};exports.getHeadDate=M;exports.getMonthDate=u;