Hackish way to show dates as dates in the table and timestamps

as date+timestamp.
This commit is contained in:
Arik Fraimovich 2014-03-06 19:58:04 +02:00
parent 10f2bc3df5
commit 02f376b6d3

View File

@ -63,7 +63,13 @@
columnDefinition['formatParameter'] = 2;
} else if (moment.isMoment(exampleData)) {
columnDefinition['formatFunction'] = function(value) {
return value.format("DD/MM/YY HH:mm");
// TODO: this is very hackish way to determine if we need
// to show the value as a time or date only. Better solution
// is to complete #70 and use the information it returns.
if (value._i.match(/^\d{4}-\d{2}-\d{2}T/)) {
return value.format("DD/MM/YY HH:mm");
}
return value.format("DD/MM/YY");
}
}
}