From b6e692ccb05a3e5a2b8747b4d5f21d0d8a235d52 Mon Sep 17 00:00:00 2001 From: Anton Dosov Date: Wed, 25 Sep 2024 19:00:53 +0200 Subject: [PATCH] [TableListView] Adjust last updated date format (#193964) ## Summary I noticed that "september" doesn't look nice as it wraps: ![Screenshot 2024-09-25 at 12 37 00](https://github.com/user-attachments/assets/9ca4a85b-bcde-4228-9c58-9cddb7f89945) I suggest we use a shorter format: ![Screenshot 2024-09-25 at 12 36 48](https://github.com/user-attachments/assets/3f2b2111-c1d9-4bae-a139-bd9ea6e38fc4) --- .../src/components/updated_at_field.tsx | 2 +- .../src/table_list_view.test.tsx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/content-management/table_list_view_table/src/components/updated_at_field.tsx b/packages/content-management/table_list_view_table/src/components/updated_at_field.tsx index 6901784089a88..f88a24000e323 100644 --- a/packages/content-management/table_list_view_table/src/components/updated_at_field.tsx +++ b/packages/content-management/table_list_view_table/src/components/updated_at_field.tsx @@ -47,7 +47,7 @@ export const UpdatedAtField: FC<{ dateTime?: string; DateFormatterComp?: DateFor } return ( - {updatedAt.format('LL')} + {updatedAt.format('ll')} ); }; diff --git a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx index 989a4eb0a0126..50c8cdfdfde3b 100644 --- a/packages/content-management/table_list_view_table/src/table_list_view.test.tsx +++ b/packages/content-management/table_list_view_table/src/table_list_view.test.tsx @@ -269,8 +269,8 @@ describe('TableListView', () => { expect(tableCellsValues).toEqual([ // Renders the datetime with this format: "July 28, 2022" - ['Item 1Item 1 description', updatedAtValues[0].format('LL')], - ['Item 2Item 2 description', updatedAtValues[1].format('LL')], + ['Item 1Item 1 description', updatedAtValues[0].format('ll')], + ['Item 2Item 2 description', updatedAtValues[1].format('ll')], ]); }); @@ -1132,11 +1132,11 @@ describe('TableListView', () => { Array [ Array [ "Item 1", - "July 15, 2023", + "Jul 15, 2023", ], Array [ "Item 2", - "July 15, 2023", + "Jul 15, 2023", ], ] `); @@ -1166,7 +1166,7 @@ describe('TableListView', () => { Array [ Array [ "Item from search", - "July 1, 2023", + "Jul 1, 2023", ], ] `); @@ -1208,11 +1208,11 @@ describe('TableListView', () => { Array [ Array [ "Item 1", - "July 15, 2023", + "Jul 15, 2023", ], Array [ "Item 2", - "July 15, 2023", + "Jul 15, 2023", ], ] `);