mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05:00
Fix Timezones
This commit is contained in:
parent
66d921620b
commit
7dfa1ad5f1
1 changed files with 3 additions and 2 deletions
|
@ -14,7 +14,7 @@ import { Devs } from "@utils/constants";
|
|||
import { openModal } from "@utils/modal";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { i18n, Menu, Tooltip, useEffect, useState } from "@webpack/common";
|
||||
import { Menu, Tooltip, useEffect, useState } from "@webpack/common";
|
||||
import { Message, User } from "discord-types/general";
|
||||
|
||||
import { SetTimezoneModal } from "./TimezoneModal";
|
||||
|
@ -27,6 +27,7 @@ export let timezones: Record<string, string | null> = {};
|
|||
})();
|
||||
|
||||
const classes = findByPropsLazy("timestamp", "compact", "contentOnly");
|
||||
const locale = findByPropsLazy("getLocale");
|
||||
|
||||
export const settings = definePluginSettings({
|
||||
"24h Time": {
|
||||
|
@ -50,7 +51,7 @@ export const settings = definePluginSettings({
|
|||
|
||||
function getTime(timezone: string, timestamp: string | number, props: Intl.DateTimeFormatOptions = {}) {
|
||||
const date = new Date(timestamp);
|
||||
const formatter = new Intl.DateTimeFormat(i18n?.getLocale?.() ?? "en-US", {
|
||||
const formatter = new Intl.DateTimeFormat(locale.getLocale() ?? "en-US", {
|
||||
hour12: !settings.store["24h Time"],
|
||||
timeZone: timezone,
|
||||
...props
|
||||
|
|
Loading…
Reference in a new issue