mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(core): fix relative date filter (#12561)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Corrected date filtering to ensure months are consistently interpreted, improving accuracy when comparing dates. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -132,10 +132,10 @@ function isAfter(
|
||||
referenceDate: readonly [number, number, number] | Dayjs
|
||||
): boolean {
|
||||
const [targetYear, targetMonth, targetDay] = isDayjs(targetDate)
|
||||
? [targetDate.year(), targetDate.month(), targetDate.date()]
|
||||
? [targetDate.year(), targetDate.month() + 1, targetDate.date()]
|
||||
: targetDate;
|
||||
const [refYear, refMonth, refDay] = isDayjs(referenceDate)
|
||||
? [referenceDate.year(), referenceDate.month(), referenceDate.date()]
|
||||
? [referenceDate.year(), referenceDate.month() + 1, referenceDate.date()]
|
||||
: referenceDate;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user