]> Untitled Git - lemmy-ui.git/commitdiff
Removing unecessary timezone adjusting
authorDessalines <tyhou13@gmx.com>
Thu, 29 Jun 2023 12:59:54 +0000 (08:59 -0400)
committerDessalines <tyhou13@gmx.com>
Thu, 29 Jun 2023 12:59:54 +0000 (08:59 -0400)
package.json
src/shared/components/common/moment-time.tsx
yarn.lock

index ef07b29d760ea34e4e9dff6d56d5f06f191fd2dc..16d3aec0d52fd787fd7567cd5c1ec0748797747c 100644 (file)
     "translations:update": "git submodule update --remote --recursive"
   },
   "lint-staged": {
-    "*.{ts,tsx,js}": [
-      "prettier --write",
-      "eslint --fix"
-    ],
-    "*.{css, scss}": [
-      "prettier --write"
-    ],
-    "package.json": [
-      "sortpack"
-    ]
+    "*.{ts,tsx,js}": ["prettier --write", "eslint --fix"],
+    "*.{css, scss}": ["prettier --write"],
+    "package.json": ["sortpack"]
   },
   "dependencies": {
     "@babel/plugin-proposal-decorators": "^7.21.0",
@@ -52,7 +45,6 @@
     "cross-fetch": "^3.1.5",
     "css-loader": "^6.7.3",
     "date-fns": "^2.30.0",
-    "date-fns-tz": "^2.0.0",
     "emoji-mart": "^5.4.0",
     "emoji-short-name": "^2.0.0",
     "express": "~4.18.2",
index 24bd3c79ed51319e782035860277af1c89ac9a97..e6586953c064a9a7c3a50a3237a069a4d68a764f 100644 (file)
@@ -1,5 +1,5 @@
 import { capitalizeFirstLetter, formatPastDate } from "@utils/helpers";
-import { formatInTimeZone } from "date-fns-tz";
+import { format } from "date-fns";
 import parseISO from "date-fns/parseISO";
 import { Component } from "inferno";
 import { I18NextService } from "../../services";
@@ -13,9 +13,8 @@ interface MomentTimeProps {
 }
 
 function formatDate(input: string) {
-  const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
   const parsed = parseISO(input + "Z");
-  return formatInTimeZone(parsed, tz, "PPPPpppp");
+  return format(parsed, "PPPPpppp");
 }
 
 export class MomentTime extends Component<MomentTimeProps, any> {
index 57cde87a711c3544c0e56f3c2e5c88b4109b1a88..46fcba11d3ec2cd9d8a4d89cb654e59f1fe65845 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -3237,11 +3237,6 @@ dashdash@^1.12.0:
   dependencies:
     assert-plus "^1.0.0"
 
-date-fns-tz@^2.0.0:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/date-fns-tz/-/date-fns-tz-2.0.0.tgz#1b14c386cb8bc16fc56fe333d4fc34ae1d1099d5"
-  integrity sha512-OAtcLdB9vxSXTWHdT8b398ARImVwQMyjfYGkKD2zaGpHseG2UPHbHjXELReErZFxWdSLph3c2zOaaTyHfOhERQ==
-
 date-fns@^2.30.0:
   version "2.30.0"
   resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0"