Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"check": "deno fmt --check . && deno lint . && deno check",
"dev": "vite",
"build": "vite build",
// todo(https://github.com/denoland/deno/pull/31718): remove this --allow-net
"start": "deno serve -P --allow-net _fresh/server.js",
"start": "deno serve -P _fresh/server.js",
"update": "deno run -A -r jsr:@fresh/update ."
},
"test": {
Expand Down
10 changes: 5 additions & 5 deletions routes/insights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,14 @@ export class InsightsPageController {
const oldestDate = allDates[0];
const today = new Date().toISOString().split("T")[0];

// Generate all dates from oldest to today
// Generate all dates from today to oldest (newest first, left to right)
const dateRange: string[] = [];
if (oldestDate) {
const current = new Date(oldestDate + "T00:00:00");
const end = new Date(today + "T00:00:00");
while (current <= end) {
const current = new Date(today + "T00:00:00");
const end = new Date(oldestDate + "T00:00:00");
while (current >= end) {
dateRange.push(current.toISOString().split("T")[0]);
current.setDate(current.getDate() + 1);
current.setDate(current.getDate() - 1);
}
}

Expand Down