Move date format to a constant in rooms.js

This commit is contained in:
dklimpel 2022-02-03 17:20:43 +01:00
parent b9e81b2278
commit 49919f3c4f

View File

@ -41,6 +41,15 @@ import {
RoomDirectorySaveButton,
} from "./RoomDirectory";
const date_format = {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
};
const useStyles = makeStyles(theme => ({
helper_forward_extremities: {
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
@ -247,14 +256,7 @@ export const RoomShow = props => {
<DateField
source="origin_server_ts"
showTime
options={{
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
options={date_format}
sortable={false}
/>
<TextField source="content" sortable={false} />
@ -287,14 +289,7 @@ export const RoomShow = props => {
<DateField
source="received_ts"
showTime
options={{
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
}}
options={date_format}
sortable={false}
/>
<NumberField source="depth" sortable={false} />