mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[date formatter] Display hyphen on null or undefined dates to be consistent with other types
This commit is contained in:
parent
0b32f8f40c
commit
07bfa7941b
2 changed files with 3 additions and 3 deletions
|
@ -13,8 +13,8 @@ describe('Date Format', function () {
|
|||
var date = new DateFormat({
|
||||
pattern: 'dd-MM-yyyy'
|
||||
});
|
||||
expect(date.convert(null)).to.be('');
|
||||
expect(date.convert(undefined)).to.be('');
|
||||
expect(date.convert(null)).to.be('-');
|
||||
expect(date.convert(undefined)).to.be('-');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -46,7 +46,7 @@ define(function (require) {
|
|||
this._memoizedPattern = pattern;
|
||||
this._memoizedConverter = _.memoize(function converter(val) {
|
||||
if (val === null || val === undefined) {
|
||||
return '';
|
||||
return '-';
|
||||
}
|
||||
return moment(val).format(pattern);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue