feat(Calendar): render days

This commit is contained in:
陈嘉涵
2019-12-26 19:59:08 +08:00
committed by neverland
parent 49781a5e15
commit f4f8952553
4 changed files with 121 additions and 15 deletions
+12
View File
@@ -0,0 +1,12 @@
export function compareMonth(date1: Date, date2: Date) {
const year1 = date1.getFullYear();
const year2 = date2.getFullYear();
const month1 = date1.getMonth();
const month2 = date2.getMonth();
if (year1 === year2) {
return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
}
return year1 > year2 ? 1 : -1;
}