return false when checking if undefined or null
This commit is contained in:
parent
2f9aa12906
commit
d18e54b02b
|
@ -1698,8 +1698,8 @@ export default function ProcessInstanceListTable({
|
|||
};
|
||||
|
||||
const formatDateTime = (_row: ProcessInstance, value: any) => {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
if (value === undefined || value === null) {
|
||||
return value;
|
||||
}
|
||||
let dateInSeconds = value;
|
||||
if (!isANumber(value)) {
|
||||
|
|
|
@ -353,7 +353,10 @@ export const setPageTitle = (items: Array<string>) => {
|
|||
|
||||
// calling it isANumber to avoid confusion with other libraries
|
||||
// that have isNumber methods
|
||||
export const isANumber = (str: string | number) => {
|
||||
export const isANumber = (str: string | number | null) => {
|
||||
if (str === undefined || str === null) {
|
||||
return false;
|
||||
}
|
||||
return /^\d+(\.\d+)?$/.test(str.toString());
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue