mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: null dates in table chart (#17974)
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
getNumberFormatter,
|
||||
} from '@superset-ui/core';
|
||||
import { DataColumnMeta } from '../types';
|
||||
import DateWithFormatter from './DateWithFormatter';
|
||||
|
||||
const xss = new FilterXSS({
|
||||
whiteList: {
|
||||
@@ -62,7 +63,12 @@ function formatValue(
|
||||
return [false, ''];
|
||||
}
|
||||
// render null as `N/A`
|
||||
if (value === null) {
|
||||
if (
|
||||
value === null ||
|
||||
// null values in temporal columns are wrapped in a Date object, so make sure we
|
||||
// handle them here too
|
||||
(value instanceof DateWithFormatter && value.input === null)
|
||||
) {
|
||||
return [false, 'N/A'];
|
||||
}
|
||||
if (formatter) {
|
||||
|
||||
Reference in New Issue
Block a user