月日历完成

This commit is contained in:
2020-10-16 16:22:21 +08:00
parent 8f3eb66639
commit 2dc82c8000
2 changed files with 44 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ import dayjs from 'dayjs'
interface Date{
day?: number;
list?: Array<unknown>;
list?: Array<any>;
}
interface GetDate{
@@ -46,7 +46,8 @@ export function getdate(yue?: number): GetDate{
i++;
const zhou = Math.floor((i + w - 1) / 7)
const d = {
day: i
day: i,
list: []
}
if(date[zhou] == undefined){
date[zhou] = []
@@ -91,4 +92,11 @@ export function getweek(zhou?: number){
}
console.log(date)
return {date, year, yue, day, zhou}
}
export function getDay(date: string){
const now = dayjs(date)
console.log(now.date())
return now.date();
}