File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -374,14 +374,14 @@ export class InsightsPageController {
374374 const oldestDate = allDates [ 0 ] ;
375375 const today = new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
376376
377- // Generate all dates from oldest to today
377+ // Generate all dates from today to oldest (newest first, left to right)
378378 const dateRange : string [ ] = [ ] ;
379379 if ( oldestDate ) {
380- const current = new Date ( oldestDate + "T00:00:00" ) ;
381- const end = new Date ( today + "T00:00:00" ) ;
382- while ( current < = end ) {
380+ const current = new Date ( today + "T00:00:00" ) ;
381+ const end = new Date ( oldestDate + "T00:00:00" ) ;
382+ while ( current > = end ) {
383383 dateRange . push ( current . toISOString ( ) . split ( "T" ) [ 0 ] ) ;
384- current . setDate ( current . getDate ( ) + 1 ) ;
384+ current . setDate ( current . getDate ( ) - 1 ) ;
385385 }
386386 }
387387
You can’t perform that action at this time.
0 commit comments