Skip to content

Commit

Permalink
Fixes #258
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed May 18, 2019
1 parent 8df3e56 commit 55af5f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/UniversalDashboard.Materialize/Components/custom-cell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,28 @@ 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) {
var moment2 = moment(y.value);
moment2 = moment(y.value);
if (moment2.isValid) {
return <span>{moment2.format(this.props.dateTimeFormat)}</span>;
}
else {
return <span>{y.DateTime}</span>;
}
}
else if (moment2.isValid) {

if (moment2.isValid) {
return <span>{moment2.format(this.props.dateTimeFormat)}</span>;
}
}
else if (y.startsWith && y.startsWith("/Date(")){
var moment2 = moment(y.substr(6), 'x)/"');
moment2 = moment(y.substr(6), 'x)/"');
if (moment2.isValid) {
return <span>{moment2.format(this.props.dateTimeFormat)}</span>;
}
Expand Down

0 comments on commit 55af5f5

Please sign in to comment.