Skip to content

Commit

Permalink
removed logs and unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Troisi committed Dec 9, 2024
1 parent 1f58e40 commit 4427327
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions pubmodules/analytics/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1766,9 +1766,6 @@ router.get('/tags/:type', async (req, res) => {
} else {
endDate = new Date(endDate);
}

console.log("startDate: ", startDate);
console.log("endDate: ", endDate);

startDate = startDate.setHours(0, 0, 0, 0);
endDate = endDate.setHours(0, 0, 0, 0);
Expand All @@ -1790,35 +1787,6 @@ router.get('/tags/:type', async (req, res) => {
return res.status(500).send({ success: false, error: "Unable to find analytics" })
})

// let parsedDates = result.map(r => new Date(parseInt(r.date)));
// console.log("parsedDates: ", parsedDates)

// let dates = parsedDates
// .map(d => d.toISOString().split('T')[0]) // Format dates as YYYY-MM-DD
// .sort();
// console.log("dates: ", dates)

// let allKeys = [...new Set(result.flatMap(o => Object.keys(o.keys)))];
// console.log("allKeys: ", allKeys)


// let series = allKeys.map(k => {
// let values = dates.map(d => {
// let count = result.find(r => new Date(parseInt(r.date)).toISOString().split('T')[0] === d);
// return count?.keys[k] || 0; // Use 0 if the tag is not present
// });
// return { name: k, values };
// });

// let data = { dates, series };
// console.log(data);


// let parsedDates = result.map(r => ({
// formatted: new Date(parseInt(r.date)).toISOString().split('T')[0], // Format date as YYYY-MM-DD
// original: r
// }));

let parsedDates = result
.sort((a, b) => parseInt(a.date) - parseInt(b.date))
.map(r => {
Expand Down

0 comments on commit 4427327

Please sign in to comment.