From ffbe3b2364094174da5b7bf2ccf9d26d67dc66c6 Mon Sep 17 00:00:00 2001 From: Anemaygi Date: Wed, 13 Nov 2024 10:03:42 -0300 Subject: [PATCH] Arrumar erro de tipagem --- .../en/LC_MESSAGES/plonegovbr.intranet.mo | Bin 0 -> 471 bytes .../pt_BR/LC_MESSAGES/plonegovbr.intranet.mo | Bin 0 -> 509 bytes .../src/components/Blocks/Calendario/View.jsx | 40 +++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.mo create mode 100644 backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.mo diff --git a/backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.mo b/backend/src/plonegovbr/intranet/locales/en/LC_MESSAGES/plonegovbr.intranet.mo new file mode 100644 index 0000000000000000000000000000000000000000..06f577285de8990e48685a84e13fcbaee593a6fb GIT binary patch literal 471 zcmYL_OHRWu5Qafwl_hHyUa%`JNyMUZA8M4iB_c1S4+(Z|b<22wIbFSywprK6*Ec`G+RXxO1zk&5sketntDNy)5T%}Qdu5Z$?=l2nxM!_=BpNN z6h+fY^p!3rRvgB(!*}|&H?>9uE~0a)`EjrW*RxW-g& zRUu?a&|o8sl~qU0Dm+uVZU~ZxbK8uaA-Y`0b_eLI0=&5FUJ_Qr3zcOhn!S~24i1_Z i|0b~VjDg@6gmkPx)xbz#x01Y6r;Y9lX#kBI>*^OOJB)$= literal 0 HcmV?d00001 diff --git a/backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.mo b/backend/src/plonegovbr/intranet/locales/pt_BR/LC_MESSAGES/plonegovbr.intranet.mo new file mode 100644 index 0000000000000000000000000000000000000000..1ae01dd28fb4837b151be6c1a9e2befd2b871700 GIT binary patch literal 509 zcmYLGOHRWu5Dkb`#Hwo+vj>+ZVo{kE5gNAy@>BYeV1rC!(xB9?9GA~QShL_L+=Byf z3MK{7k)P({=b5MRS8MOhLfb_gAdZ>@t@rCTejnpL;(f=muF$s--xyn&cq+v+)P@^j zrCL3TxgkMLW_rTEEb@Zz-1Gg6 zjmKw5mBpGDf=mQoQV6|xG;PH7!tlH*+e#N_b`(TxE8l5%?17R-NSyJyLbXP`nB!H& zOL+?O1=qDO{k3@@-7T-t@*p%}a<1}H78JVorLog$t$9U;N-t{)a M7oeNXetszH2P#{Y2><{9 literal 0 HcmV?d00001 diff --git a/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx b/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx index 0a9a81e..3022e17 100644 --- a/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx +++ b/frontend/packages/portalbrasil-intranet/src/components/Blocks/Calendario/View.jsx @@ -5,32 +5,34 @@ import { parseDate } from '@internationalized/date'; import withQuerystringResults from './withQuerystringResults'; const groupByDate = (items) => { - return items - .reduce((map, obj) => { - if (!obj.start) { - return null; - } + return Object.values( + items + .reduce((map, obj) => { + if (!obj.start) { + return null; + } - let start = obj.start ? parseDate(obj.start.slice(0, 10)) : null; - const end = obj.end ? parseDate(obj.end.slice(0, 10)) : start; + let start = obj.start ? parseDate(obj.start.slice(0, 10)) : null; + const end = obj.end ? parseDate(obj.end.slice(0, 10)) : start; - while (start < end) { - const key = start.toString(); + while (start < end) { + const key = start.toString(); - if (key) { - if (map[key] === undefined) { - map[key] = []; + if (key) { + if (map[key] === undefined) { + map[key] = []; + } + map[key].push(obj); } - map[key].push(obj); - } - start = start.add({ days: 1 }); - } - return map; - }, {}) - .filter((item) => item !== null); + start = start.add({ days: 1 }); + } + return map; + }, {}) + ).filter((item) => item !== null); }; + const CalendarioBlockView = withQuerystringResults((props) => { const { data, isEditMode, path, pathname, className, listingItems } = props; const items = listingItems ? groupByDate(listingItems) : {};