From 799fff7c0ebd1893fe7fbbfb82f0046ddbbd2e82 Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 6 Oct 2022 11:47:05 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=20=D0=B2=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0?= =?UTF-8?q?=D1=85=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Documents/DocumentsTemplate.jsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Documents/DocumentsTemplate.jsx index dbb4576..60d132d 100755 --- a/src/pages/Documents/DocumentsTemplate.jsx +++ b/src/pages/Documents/DocumentsTemplate.jsx @@ -40,7 +40,7 @@ export const DocumentsTemplate = ({ idCategory, well: givenWell, mimeTypes, head ), }, makeDateColumn('Дата загрузки', 'uploadDate'), - makeNumericColumn('Размер', 'size', null, null, formatBytes), + makeNumericColumn('Размер', 'size', null, null, (value) => formatBytes(value)), makeColumn('Автор', 'author', { render: item => }), makeColumn('Компания', 'company', { render: (_, record) => }), ...(customColumns ?? []) @@ -49,12 +49,8 @@ export const DocumentsTemplate = ({ idCategory, well: givenWell, mimeTypes, head const filenames = useMemo(() => files.map(file => file.name).filter(Boolean).filter(unique), [files]) const update = useCallback(() => { - let begin = null - let end = null - if (filterDataRange?.length > 1) { - begin = filterDataRange[0].toISOString() - end = filterDataRange[1].toISOString() - } + const begin = filterDataRange?.length > 1 ? filterDataRange[0].toISOString() : null + const end = filterDataRange?.length > 1 ? filterDataRange[1].toISOString() : null invokeWebApiWrapperAsync( async () => {