mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
fix export crash due to toDate issue
This commit is contained in:
@@ -35,8 +35,13 @@ export const config: IFieldConfig = {
|
||||
filter: { operators: filterOperators, valueFormatter },
|
||||
settings: Settings,
|
||||
csvImportParser: (value, config) => parse(value, DATE_FORMAT, new Date()),
|
||||
csvExportFormatter: (value: any, config?: any) =>
|
||||
format(value.toDate(), DATE_FORMAT),
|
||||
csvExportFormatter: (value: any, config?: any) => {
|
||||
if (typeof value === "number") {
|
||||
return format(new Date(value), DATE_FORMAT);
|
||||
} else {
|
||||
return format(value.toDate(), DATE_FORMAT);
|
||||
}
|
||||
},
|
||||
};
|
||||
export default config;
|
||||
|
||||
|
||||
@@ -47,8 +47,13 @@ export const config: IFieldConfig = {
|
||||
},
|
||||
settings: Settings,
|
||||
csvImportParser: (value) => new Date(value),
|
||||
csvExportFormatter: (value: any, config?: any) =>
|
||||
format(value.toDate(), DATE_TIME_FORMAT),
|
||||
csvExportFormatter: (value: any, config?: any) => {
|
||||
if (typeof value === "number") {
|
||||
return format(new Date(value), config?.format || DATE_TIME_FORMAT);
|
||||
} else {
|
||||
return format(value.toDate(), config?.format || DATE_TIME_FORMAT);
|
||||
}
|
||||
},
|
||||
};
|
||||
export default config;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user