ccusage-ui
Advanced tools
+1
-1
| { | ||
| "name": "ccusage-ui", | ||
| "version": "0.1.15", | ||
| "version": "0.1.16", | ||
| "main": "server.js", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -706,5 +706,5 @@ <!DOCTYPE html> | ||
| // Aggregate costs by model from the last 30 days of daily data | ||
| // Aggregate costs by model from the most recent 30 days | ||
| const modelCosts = {}; | ||
| dailyData.slice(-30).forEach(day => { | ||
| [...dailyData].sort((a, b) => b.date.localeCompare(a.date)).slice(0, 30).forEach(day => { | ||
| if (day.modelBreakdowns) { | ||
@@ -739,4 +739,4 @@ day.modelBreakdowns.forEach(m => { | ||
| tbody.innerHTML = ''; | ||
| // Show last 10 days reversed | ||
| const recent = [...dailyData].reverse().slice(0, 10); | ||
| // Sort by date descending (newest first) and take top 10 | ||
| const recent = [...dailyData].sort((a, b) => b.date.localeCompare(a.date)).slice(0, 10); | ||
@@ -743,0 +743,0 @@ recent.forEach(d => { |
3061315
0