fix: incorrect timeline month display (#2792)

Fix incorrect timeline month display
This commit is contained in:
Wen Sun 2024-01-19 19:07:08 +09:00 committed by GitHub
parent 2e0619b4dc
commit ec4884ea04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,7 +49,7 @@ const ActivityCalendar = (props: Props) => {
return (
<div className={classNames("w-28 h-auto p-0.5 shrink-0 grid grid-cols-7 grid-flow-row gap-1")}>
{days.map((day, index) => {
const date = getNormalizedDateString(`${year}-${month}-${day}`);
const date = getNormalizedDateString(`${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`);
const count = data[date] || 0;
const isToday = new Date().toDateString() === new Date(date).toDateString();
const tooltipText = count ? `${count} memos in ${date}` : date;