Add ability to configure the locale timezone (#2523)

This commit is contained in:
Arthur Knoepflin authored and GitHub committed 2021-04-20 09:26:52 -04:00
1 parent 8d42d40433
commit 52ebcc4fdb
11 files changed
+84 -8

No files matched your search

@@ -0,0 +1 @@
export * from "./locale-date";
@@ -0,0 +1,18 @@
import React from "react";
import { observer } from "mobx-react";
import moment from "moment-timezone";
import { userStore } from "../../../common/user-store";
interface Props {
date: string
}
@observer
export class LocaleDate extends React.Component<Props> {
render() {
const { preferences } = userStore;
const { date } = this.props;
return <>{moment.tz(date, preferences.localeTimezone).format()}</>;
}
}