From 2a31a8b3a1259fc221171f2fb16b8ef0e255f227 Mon Sep 17 00:00:00 2001 From: Vu Khanh Du Date: Fri, 2 Feb 2024 13:42:56 +0700 Subject: [PATCH] fix date format --- .../report-detail/report-overview-table.tsx | 11 +++++++---- .../src/components/report-detail/report-table.tsx | 3 +++ cope2n-fe/src/pages/dashboard/index.tsx | 2 ++ cope2n-fe/src/pages/reports/report_detail/index.tsx | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cope2n-fe/src/components/report-detail/report-overview-table.tsx b/cope2n-fe/src/components/report-detail/report-overview-table.tsx index 3f5f813..c0085d1 100644 --- a/cope2n-fe/src/components/report-detail/report-overview-table.tsx +++ b/cope2n-fe/src/components/report-detail/report-overview-table.tsx @@ -295,6 +295,9 @@ const ReportOverViewTable: React.FC = ({ dataIndex: 'extractionDate', key: 'extractionDate', width: '130px', + render: (_, record) => { + return {record?.extractionDate.toString().split('T')[0]}; + }, }, { title: 'SN/IMEI', @@ -452,10 +455,10 @@ const ReportOverViewTable: React.FC = ({ scroll={{ x: 2000 }} pagination={{ current: pagination.page, - pageSize: pagination.page_size, - total: overviewDataResponse?.page.count, - showTotal: (total, range) => - `${range[0]}-${range[1]} of ${total} items`, + pageSize: 10, + total: dataSubsRows?.length, + // showTotal: (total, range) => + // `${range[0]}-${range[1]} of ${total} items`, onChange: (page, pageSize) => { setPagination({ page, diff --git a/cope2n-fe/src/components/report-detail/report-table.tsx b/cope2n-fe/src/components/report-detail/report-table.tsx index 0a929cc..09e7550 100644 --- a/cope2n-fe/src/components/report-detail/report-table.tsx +++ b/cope2n-fe/src/components/report-detail/report-table.tsx @@ -43,6 +43,9 @@ const ReportTable: React.FC = () => { title: 'Created Date', dataIndex: 'Created Date', key: 'Created Date', + render: (_, record) => { + return {record['Created Date'].toString().split('T')[0]}; + }, }, { title: 'No. Requests', diff --git a/cope2n-fe/src/pages/dashboard/index.tsx b/cope2n-fe/src/pages/dashboard/index.tsx index 3b71a0c..a3522f0 100644 --- a/cope2n-fe/src/pages/dashboard/index.tsx +++ b/cope2n-fe/src/pages/dashboard/index.tsx @@ -32,6 +32,8 @@ const Dashboard = () => { start_date: fromData.start_date, end_date: fromData.end_date, subsidiary: fromData.subsidiary, + page: pagination.page, + page_size: 30, }); const handleSubmit = (values: ReportFormValues) => { console.log('check values >>>', values); diff --git a/cope2n-fe/src/pages/reports/report_detail/index.tsx b/cope2n-fe/src/pages/reports/report_detail/index.tsx index 443cf51..10546ad 100644 --- a/cope2n-fe/src/pages/reports/report_detail/index.tsx +++ b/cope2n-fe/src/pages/reports/report_detail/index.tsx @@ -302,13 +302,13 @@ const ReportDetail = () => { Start date:{' '} - {report_data?.metadata?.start_at} + {report_data?.metadata?.start_at.split('T')[0]} End date:{' '} - {report_data?.metadata?.end_at} + {report_data?.metadata?.end_at.split('T')[0]}