Skip to content

Commit

Permalink
Arrumar erro de tipagem
Browse files Browse the repository at this point in the history
  • Loading branch information
Anemaygi committed Nov 13, 2024
1 parent ad3bcd1 commit ffbe3b2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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) : {};
Expand Down

0 comments on commit ffbe3b2

Please # to comment.