mirror of
https://github.com/getredash/redash.git
synced 2026-05-13 06:00:53 -04:00
Merge pull request #2148 from kyoshidajp/replace_datetime_strings
Replace invalid date time strings
This commit is contained in:
@@ -6,9 +6,15 @@ export default function init(ngModule) {
|
||||
ngModule.filter('dateTime', clientConfig =>
|
||||
function dateTime(value) {
|
||||
if (!value) {
|
||||
return '-';
|
||||
return '';
|
||||
}
|
||||
|
||||
return moment(value).format(clientConfig.dateTimeFormat);
|
||||
|
||||
const parsed = moment(value);
|
||||
|
||||
if (!parsed.isValid()) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return parsed.format(clientConfig.dateTimeFormat);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user