diff --git a/web/src/components/kit/DatePicker.tsx b/web/src/components/kit/DatePicker.tsx index ce7dc025..f429e05c 100644 --- a/web/src/components/kit/DatePicker.tsx +++ b/web/src/components/kit/DatePicker.tsx @@ -4,7 +4,7 @@ import { useEffect, useRef, useState } from "react"; import useClickAway from "react-use/lib/useClickAway"; import { memoServiceClient } from "@/grpcweb"; import { DAILY_TIMESTAMP } from "@/helpers/consts"; -import { getDateStampByDate, isFutureDate } from "@/helpers/datetime"; +import { getDateStampByDate, getTimeStampByDate, isFutureDate } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useTranslate } from "@/utils/i18n"; import Icon from "../Icon"; @@ -41,7 +41,8 @@ const DatePicker: React.FC = (props: DatePickerProps) => { }); const m = new Map(); Object.entries(memoCreationStats).forEach(([k]) => { - const date = getDateStampByDate(k); + const utcOffsetMilliseconds = new Date().getTimezoneOffset() * 60 * 1000; + const date = getDateStampByDate(new Date(getTimeStampByDate(k) + utcOffsetMilliseconds)); m.set(date, true); }); setCountByDate(m);