refactor: Add frontend code to DB-GPT (#912)

This commit is contained in:
katakuri
2023-12-11 00:05:42 +08:00
committed by GitHub
parent b8dc9cf11e
commit 43190ca333
189 changed files with 19179 additions and 16 deletions

View File

@@ -0,0 +1,16 @@
type BasicDataPropertyForAdvice = any;
/**
* Process date column to new Date().
* @param field
* @param dataProps
* @returns
*/
export function processDateEncode(field: string, dataProps: BasicDataPropertyForAdvice[]) {
const dp = dataProps.find((dataProp) => dataProp.name === field);
if (dp?.recommendation === 'date') {
return (d: any) => new Date(d[field]);
}
return field;
}