Fix: use local timezone as default (#615)
* use local timezone as default * refactor code * fix time display
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
CheckCircleIcon,
|
||||
AudioWaveformIcon,
|
||||
} from "lucide-react";
|
||||
import dayjs from "dayjs";
|
||||
import dayjs from "@renderer/lib/dayjs";
|
||||
import { secondsToTimestamp } from "@renderer/lib/utils";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { MessageCircleIcon, SpeechIcon } from "lucide-react";
|
||||
import dayjs from "dayjs";
|
||||
import dayjs from "@renderer/lib/dayjs";
|
||||
|
||||
export const ConversationCard = (props: { conversation: ConversationType }) => {
|
||||
const { conversation } = props;
|
||||
|
||||
@@ -6,11 +6,9 @@ import Calendar, {
|
||||
} from "react-activity-calendar";
|
||||
import { AppSettingsProviderContext, useTheme } from "@renderer/context";
|
||||
import { ScrollArea, Button } from "@renderer/components/ui";
|
||||
import i18next, { t } from "i18next";
|
||||
import dayjs, { Dayjs } from "dayjs";
|
||||
import "dayjs/locale/en";
|
||||
import "dayjs/locale/zh-cn";
|
||||
import localeData from "dayjs/plugin/localeData";
|
||||
import { t } from "i18next";
|
||||
import dayjs from "@renderer/lib/dayjs";
|
||||
import { Dayjs } from "dayjs";
|
||||
import { Tooltip } from "react-tooltip";
|
||||
|
||||
const DEFAULT_THEME: ThemeInput = {
|
||||
@@ -24,9 +22,6 @@ export const RecordingCalendar = (props: {
|
||||
const { onSelectRange } = props;
|
||||
const { colorScheme } = useTheme();
|
||||
|
||||
dayjs.extend(localeData);
|
||||
dayjs.locale(i18next.resolvedLanguage?.toLowerCase() || "en");
|
||||
|
||||
const [tab, setTab] = useState<string | number>("lastYear");
|
||||
const [range, setRange] = useState<[Dayjs, Dayjs]>([
|
||||
dayjs().subtract(1, "year").add(1, "day"),
|
||||
@@ -136,7 +131,7 @@ export const RecordingCalendar = (props: {
|
||||
}),
|
||||
}}
|
||||
theme={DEFAULT_THEME}
|
||||
colorScheme={colorScheme as 'light' | 'dark'}
|
||||
colorScheme={colorScheme as "light" | "dark"}
|
||||
renderBlock={(block, activity) =>
|
||||
React.cloneElement(block, {
|
||||
...block.props,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
CardContent,
|
||||
} from "@renderer/components/ui";
|
||||
import { t } from "i18next";
|
||||
import dayjs from "dayjs";
|
||||
import dayjs from "@renderer/lib/dayjs";
|
||||
|
||||
export const RecordingStats = () => {
|
||||
return (
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
CheckCircleIcon,
|
||||
AudioWaveformIcon,
|
||||
} from "lucide-react";
|
||||
import dayjs from "dayjs";
|
||||
import dayjs from "@renderer/lib/dayjs";
|
||||
import { secondsToTimestamp } from "@renderer/lib/utils";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user