File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import ModelInstanceEditForm from "./ModelInstanceEditForm";
1818import Theme from "./theme" ;
1919import {
2020 copyToClipboard ,
21- formatTimeStampToLongString ,
21+ formatTimeStampAsDate ,
2222 showNotification ,
2323} from "./utils" ;
2424import 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 >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import WarningBox from "./WarningBox";
1818import Theme from "./theme" ;
1919import {
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 >
Original file line number Diff line number Diff 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+
4554export function formatTimeStampToCompact ( ISOtimestamp ) {
4655 if ( ISOtimestamp ) {
4756 return moment ( ISOtimestamp ) . format ( "DD-MM-YYYY (HH:MM)" ) ;
You can’t perform that action at this time.
0 commit comments