Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DatePicker Local Date #2766

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions web/src/components/kit/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -41,7 +41,8 @@ const DatePicker: React.FC<DatePickerProps> = (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);
Expand Down
Loading