diff --git a/packages/discord-types/src/components.d.ts b/packages/discord-types/src/components.d.ts index d88497762..ff9ed31c5 100644 --- a/packages/discord-types/src/components.d.ts +++ b/packages/discord-types/src/components.d.ts @@ -65,6 +65,8 @@ export interface TooltipProps { tooltipClassName?: string; tooltipContentClassName?: string; + + delay?: number; } export type Tooltip = ComponentType & { diff --git a/src/equicordplugins/timezones/index.tsx b/src/equicordplugins/timezones/index.tsx index 02c287c7f..6e9ceb7e2 100644 --- a/src/equicordplugins/timezones/index.tsx +++ b/src/equicordplugins/timezones/index.tsx @@ -14,7 +14,7 @@ import { Devs, EquicordDevs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { Message, User } from "@vencord/discord-types"; import { findByPropsLazy, findCssClassesLazy } from "@webpack"; -import { Button, Menu, openModal,showToast, Toasts, Tooltip, useEffect, UserStore, useState } from "@webpack/common"; +import { Button, Menu, openModal, showToast, Toasts, Tooltip, useEffect, UserStore, useState } from "@webpack/common"; import { deleteTimezone, getTimezone, loadDatabaseTimezones, setUserDatabaseTimezone } from "./database"; import { SetTimezoneModal } from "./TimezoneModal"; @@ -84,6 +84,12 @@ export const settings = definePluginSettings({ default: true }, + showLocalTimezone: { + type: OptionType.BOOLEAN, + description: "Show Local Timezone instead of just local", + default: false, + }, + databaseUrl: { type: OptionType.STRING, description: "Database URL for timezone storage", @@ -195,12 +201,14 @@ const TimestampComponent = ErrorBoundary.wrap(({ userId, timestamp, type }: Prop if (settings.store.showTimezoneInfo) { const userTimezone = getSystemTimezone(); - if (timezone === userTimezone) { + if (timezone === userTimezone && !settings.store.showLocalTimezone) { displayTime = "local"; isLocal = true; } else { const timezoneInfo = getTimezoneAbbreviation(timezone, currentTime); - displayTime = `${shortTime} ${timezoneInfo || timezone}`; + const tz = timezoneInfo || timezone; + const hideLocalTime = settings.store.showLocalTimezone && type === "message"; + displayTime = hideLocalTime ? tz : `${shortTime} ${tz}`; } } @@ -218,7 +226,6 @@ const TimestampComponent = ErrorBoundary.wrap(({ userId, timestamp, type }: Prop return (