diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 86ee0f8326..af4e76add9 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -13,6 +13,7 @@ import { dateFormats, extractPkFromRow, extractSdkResponseErrorMsg, + isDateMonthFormat, isDrawerOrModalExist, isExpandedCellInputExist, isMac, @@ -153,6 +154,17 @@ export function useMultiSelect( } } + if (columnObj.uidt === UITypes.Date) { + const dateFormat = columnObj.meta.date_format + if (isDateMonthFormat(dateFormat)) { + // any date month format (e.g. YYYY-MM) couldn't be stored in database + // with date type since it is not a valid date + // therefore, we reformat the value here to display with the formatted one + // e.g. 2023-06-03 -> 2023-06 + textToCopy = dayjs(textToCopy, dateFormat).format(dateFormat) + } + } + if (columnObj.uidt === UITypes.Time) { // remove `"` // e.g. "2023-05-12T08:03:53.000Z" -> 2023-05-12T08:03:53.000Z