mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-12 10:34:17 +00:00
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) => {
|
const formatDateTime = (_row: ProcessInstance, value: any) => {
|
||||||
if (value === undefined) {
|
if (value === undefined || value === null) {
|
||||||
return undefined;
|
return value;
|
||||||
}
|
}
|
||||||
let dateInSeconds = value;
|
let dateInSeconds = value;
|
||||||
if (!isANumber(value)) {
|
if (!isANumber(value)) {
|
||||||
|
@ -353,7 +353,10 @@ export const setPageTitle = (items: Array<string>) => {
|
|||||||
|
|
||||||
// calling it isANumber to avoid confusion with other libraries
|
// calling it isANumber to avoid confusion with other libraries
|
||||||
// that have isNumber methods
|
// 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());
|
return /^\d+(\.\d+)?$/.test(str.toString());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user