File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ async function getLast30Days() {
4343 for ( let i = 29 ; i >= 0 ; i -- ) {
4444 const date = new Date ( today ) ;
4545 date . setDate ( today . getDate ( ) - i ) ;
46- const formattedDate = date . toISOString ( ) . slice ( 0 , 10 ) ; // Get yyyy-mm-dd format
46+ const year = date . getFullYear ( ) ;
47+ const month = String ( date . getMonth ( ) + 1 ) . padStart ( 2 , '0' ) ;
48+ const day = String ( date . getDate ( ) ) . padStart ( 2 , '0' ) ;
49+ const formattedDate = `${ year } -${ month } -${ day } ` ;
4750 labels . push ( formattedDate ) ;
4851 }
4952 return labels ;
Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ async function getPreviousDays(dayCount) {
120120 for ( let i = dayCount ; i >= 0 ; i -- ) {
121121 const date = new Date ( today ) ;
122122 date . setDate ( today . getDate ( ) - i ) ;
123- const formattedDate = date . toISOString ( ) . slice ( 0 , 10 ) ;
123+ const year = date . getFullYear ( ) ;
124+ const month = String ( date . getMonth ( ) + 1 ) . padStart ( 2 , '0' ) ;
125+ const day = String ( date . getDate ( ) ) . padStart ( 2 , '0' ) ;
126+ const formattedDate = `${ year } -${ month } -${ day } ` ;
127+
124128 labels . push ( formattedDate ) ;
125129 }
126130 return labels ;
You can’t perform that action at this time.
0 commit comments