From 4b0845bee8bcad6a995beb4a50ccb4bcd018b1ff Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Thu, 17 Feb 2022 20:50:38 +0100 Subject: [PATCH] Move date format to a constant in `users.js` (#223) * Move date format to a constant in `users.js` * yarn prettier --- src/components/users.js | 71 +++++++++-------------------------------- 1 file changed, 15 insertions(+), 56 deletions(-) diff --git a/src/components/users.js b/src/components/users.js index 83694f9..ecc35f6 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} /> @@ -336,18 +338,7 @@ export const UserEdit = props => { source="deactivated" helperText="resources.users.helper.deactivate" /> - + @@ -404,14 +395,7 @@ export const UserEdit = props => { @@ -439,14 +423,7 @@ export const UserEdit = props => { { sort={{ field: "created_ts", order: "DESC" }} > - +