feat(calendar): add isSameLocalDay function and integrate it into calendar components

This commit is contained in:
mlogclub
2026-04-29 14:54:19 +08:00
parent 9d9687ec5a
commit e56fe82b3a
4 changed files with 33 additions and 6 deletions
@@ -12,6 +12,10 @@ export function startOfWeek(date: Date) {
return ret
}
export function isSameLocalDay(a: Date, b: Date) {
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()
}
export function startOfMonth(date: Date) {
const ret = startOfDay(date)
ret.setDate(1)