Skip to content

Commit

Permalink
Fixes #811
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed May 23, 2019
1 parent ec7eb3c commit 824c233
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/UniversalDashboard.Materialize/Components/custom-cell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ export default class CustomCell extends React.Component {
const validComponents = ["link", "icon", "image", "element"]

var y = this.props.value;
var moment2 = moment(y);

if (y == null) {
return <span></span>;
}
if (y.DateTime) {
moment2 = moment(y.value);
var moment2 = moment(y.value);
if (moment2.isValid) {
return <span>{moment2.format(this.props.dateTimeFormat)}</span>;
}
Expand All @@ -27,7 +26,7 @@ export default class CustomCell extends React.Component {
}
}
else if (y.startsWith && y.startsWith("/Date(")){
moment2 = moment(y.substr(6), 'x)/"');
var moment2 = moment(y.substr(6), 'x)/"');
if (moment2.isValid) {
return <span>{moment2.format(this.props.dateTimeFormat)}</span>;
}
Expand Down

0 comments on commit 824c233

Please sign in to comment.