|
|
@ -28,6 +28,7 @@ import { |
|
|
|
useI18n, |
|
|
|
useI18n, |
|
|
|
useMetas, |
|
|
|
useMetas, |
|
|
|
useUndoRedo, |
|
|
|
useUndoRedo, |
|
|
|
|
|
|
|
parseProp, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
const MAIN_MOUSE_PRESSED = 0 |
|
|
|
const MAIN_MOUSE_PRESSED = 0 |
|
|
@ -173,7 +174,7 @@ export function useMultiSelect( |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ([UITypes.DateTime, UITypes.CreatedTime, UITypes.LastModifiedTime].includes(columnObj.uidt)) { |
|
|
|
if ([UITypes.DateTime, UITypes.CreatedTime, UITypes.LastModifiedTime].includes(columnObj.uidt as UITypes)) { |
|
|
|
// remove `"`
|
|
|
|
// remove `"`
|
|
|
|
// e.g. "2023-05-12T08:03:53.000Z" -> 2023-05-12T08:03:53.000Z
|
|
|
|
// e.g. "2023-05-12T08:03:53.000Z" -> 2023-05-12T08:03:53.000Z
|
|
|
|
textToCopy = textToCopy.replace(/["']/g, '') |
|
|
|
textToCopy = textToCopy.replace(/["']/g, '') |
|
|
@ -194,14 +195,15 @@ export function useMultiSelect( |
|
|
|
// therefore, here we reformat to the correct datetime format based on the meta
|
|
|
|
// therefore, here we reformat to the correct datetime format based on the meta
|
|
|
|
textToCopy = d.format(constructDateTimeFormat(columnObj)) |
|
|
|
textToCopy = d.format(constructDateTimeFormat(columnObj)) |
|
|
|
|
|
|
|
|
|
|
|
if (!dayjs(textToCopy).isValid()) { |
|
|
|
if (!d.isValid()) { |
|
|
|
// return empty string for invalid datetime
|
|
|
|
// return empty string for invalid datetime
|
|
|
|
return '' |
|
|
|
return '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (columnObj.uidt === UITypes.Date) { |
|
|
|
if (columnObj.uidt === UITypes.Date) { |
|
|
|
const dateFormat = columnObj.meta?.date_format |
|
|
|
const dateFormat = parseProp(columnObj.meta)?.date_format |
|
|
|
|
|
|
|
|
|
|
|
if (dateFormat && isDateMonthFormat(dateFormat)) { |
|
|
|
if (dateFormat && isDateMonthFormat(dateFormat)) { |
|
|
|
// any date month format (e.g. YYYY-MM) couldn't be stored in database
|
|
|
|
// any date month format (e.g. YYYY-MM) couldn't be stored in database
|
|
|
|
// with date type since it is not a valid date
|
|
|
|
// with date type since it is not a valid date
|
|
|
|