Added useFormat hook to format special values.

This commit is contained in:
Mike Cao 2023-08-07 15:02:50 -07:00
parent a71cf675ae
commit 2eee9c23c3
9 changed files with 68 additions and 19 deletions

View file

@ -25,7 +25,7 @@ export function flattenJSON(
).keyValues;
}
export function getDynamicDataType(value: any): string {
export function getDataType(value: any): string {
let type: string = typeof value;
if ((type === 'string' && isValid(value)) || isValid(parseISO(value))) {
@ -36,7 +36,7 @@ export function getDynamicDataType(value: any): string {
}
function createKey(key, value, acc: { keyValues: any[]; parentKey: string }) {
const type = getDynamicDataType(value);
const type = getDataType(value);
let dynamicDataType = null;