Skip to content

Commit 49f8a55

Browse files
committed
model instance timestamp is now a date, so the time is always 00:00:00 - better to just show it as a date.
1 parent 44e837b commit 49f8a55

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

apps/model_catalog/src/ModelDetailContent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import ModelInstanceEditForm from "./ModelInstanceEditForm";
1818
import Theme from "./theme";
1919
import {
2020
copyToClipboard,
21-
formatTimeStampToLongString,
21+
formatTimeStampAsDate,
2222
showNotification,
2323
} from "./utils";
2424
import Avatar from "@material-ui/core/Avatar";
@@ -602,7 +602,7 @@ class ModelDetailContent extends React.Component {
602602
color="textSecondary"
603603
style={{ marginBottom: 10 }}
604604
>
605-
{formatTimeStampToLongString(
605+
{formatTimeStampAsDate(
606606
instance.timestamp
607607
)}
608608
</Typography>

apps/model_catalog/src/ModelDetailHeader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import WarningBox from "./WarningBox";
1818
import Theme from "./theme";
1919
import {
2020
copyToClipboard,
21-
formatTimeStampToLongString,
21+
formatTimeStampAsDate,
2222
showNotification,
2323
} from "./utils";
2424

@@ -345,7 +345,7 @@ class ModelDetailHeader extends React.Component {
345345
>
346346
Created:{" "}
347347
<b>
348-
{formatTimeStampToLongString(
348+
{formatTimeStampAsDate(
349349
this.props.dateCreated
350350
)}
351351
</b>

apps/model_catalog/src/utils.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ export function formatTimeStampToLongString(ISOtimestamp) {
4242
}
4343
}
4444

45+
export function formatTimeStampAsDate(ISOtimestamp) {
46+
if (ISOtimestamp) {
47+
const d = new Date(ISOtimestamp);
48+
return d.toDateString();
49+
} else {
50+
return "";
51+
}
52+
}
53+
4554
export function formatTimeStampToCompact(ISOtimestamp) {
4655
if (ISOtimestamp) {
4756
return moment(ISOtimestamp).format("DD-MM-YYYY (HH:MM)");

0 commit comments

Comments
 (0)