Skip to content

Commit

Permalink
Fix infinite loop in Timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzdogan committed May 16, 2024
1 parent fcaf03e commit edc0990
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/lib/components/TimelineHeatmap.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@
}
const segments = [];
let currentSegment = '00:00';
while (!segments.includes(currentSegment)) {
segments.push(format(toDate(startDate + 'T' + currentSegment, { timeZone: config.tz }), 'HH:mm', { timeZone: config.tz }));
currentSegment = format(
addMinutes(toDate(startDate + 'T' + currentSegment, { timeZone: config.tz }), segmentMinutes),
'HH:mm',
{ timeZone: config.tz }
);
let currentSegment = '00:00';
for (let hour = 0; hour < 24; hour++) {
const segment = `${String(hour).padStart(2, '0')}:00`;
segments.push(segment);
}
const timelineData = {};
Expand Down

0 comments on commit edc0990

Please sign in to comment.