From 7ca5248b3d2f551f47f4ee5955d80ddbcd86feb1 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 6 Jan 2022 13:28:31 +0100 Subject: [PATCH] Move date format to a constant in `users.js` --- src/components/users.js | 63 ++++++++++------------------------------- 1 file changed, 15 insertions(+), 48 deletions(-) diff --git a/src/components/users.js b/src/components/users.js index 83694f9..73d3b09 100644 --- a/src/components/users.js +++ b/src/components/users.js @@ -71,6 +71,15 @@ const useStyles = makeStyles({ }, }); +const date_format = { + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", +}; + const UserListActions = ({ currentSort, className, @@ -180,14 +189,7 @@ export const UserList = props => { source="creation_ts" label="resources.users.fields.creation_ts_ms" showTime - options={{ - year: "numeric", - month: "2-digit", - day: "2-digit", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - }} + options={date_format} /> @@ -339,14 +341,7 @@ export const UserEdit = props => { @@ -404,14 +399,7 @@ export const UserEdit = props => { @@ -439,14 +427,7 @@ export const UserEdit = props => { {