From a9e50d29d35a867442e8690465ea9a9bc977bd1c Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 4 Jan 2025 23:34:20 +0800 Subject: [PATCH] fix display incorrect month --- src/lib/datetime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/datetime.ts b/src/lib/datetime.ts index e7c28990..8a54b316 100644 --- a/src/lib/datetime.ts +++ b/src/lib/datetime.ts @@ -347,8 +347,8 @@ export function getYearMonthFirstUnixTime(yearMonth: YearMonth | string): number if (isString(yearMonth)) { yearMonthObj = getYearMonthObjectFromString(yearMonth as string); - } else if (isObject(yearMonth) && !isYearMonthValid((yearMonth as YearMonth).year, (yearMonth as YearMonth).month)) { - yearMonthObj = null; + } else if (isObject(yearMonth) && isYearMonthValid((yearMonth as YearMonth).year, (yearMonth as YearMonth).month)) { + yearMonthObj = yearMonth as YearMonth; } if (!yearMonthObj) {