From a9556e2471ac7af685c5b0e8d512e55f4017b882 Mon Sep 17 00:00:00 2001 From: Efekan Date: Thu, 15 Feb 2024 17:41:55 +0300 Subject: [PATCH 1/2] copy/paste is unavailable in isoDateColumn cells since copyValue props is not passed. --- src/columns/isoDateColumn.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/columns/isoDateColumn.tsx b/src/columns/isoDateColumn.tsx index 55a0e95..0ebac04 100644 --- a/src/columns/isoDateColumn.tsx +++ b/src/columns/isoDateColumn.tsx @@ -49,6 +49,7 @@ export const isoDateColumn: Partial> = { component: IsoDateComponent as CellComponent, deleteValue: () => null, // Because the Date constructor works using iso format, we can use it to parse ISO string back to a Date object + copyValue: ({ rowData }) => rowData, pasteValue: ({ value }) => { const date = new Date(value.replace(/\.\s?|\//g, '-')) return isNaN(date.getTime()) ? null : date.toISOString().substr(0, 10) From 30c90487549a9b4e279b1320ba8bc491e240d658 Mon Sep 17 00:00:00 2001 From: Efekan Date: Thu, 15 Feb 2024 17:45:18 +0300 Subject: [PATCH 2/2] line ordering --- src/columns/isoDateColumn.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/columns/isoDateColumn.tsx b/src/columns/isoDateColumn.tsx index 0ebac04..7bcac3a 100644 --- a/src/columns/isoDateColumn.tsx +++ b/src/columns/isoDateColumn.tsx @@ -48,8 +48,8 @@ IsoDateComponent.displayName = 'IsoDateComponent' export const isoDateColumn: Partial> = { component: IsoDateComponent as CellComponent, deleteValue: () => null, - // Because the Date constructor works using iso format, we can use it to parse ISO string back to a Date object copyValue: ({ rowData }) => rowData, + // Because the Date constructor works using iso format, we can use it to parse ISO string back to a Date object pasteValue: ({ value }) => { const date = new Date(value.replace(/\.\s?|\//g, '-')) return isNaN(date.getTime()) ? null : date.toISOString().substr(0, 10)