@@ -264,7 +264,8 @@ <h1 class="title">Dashboard</h1>
264264 < div class ="control-box ">
265265 < label for ="date-preset "> Period</ label >
266266 < select id ="date-preset ">
267- < option value ="week " selected > Past Week</ option >
267+ < option value ="today " selected > Today</ option >
268+ < option value ="week "> Past Week</ option >
268269 < option value ="month "> Past Month</ option >
269270 < option value ="year "> Past Year</ option >
270271 < option value ="custom "> Custom Range...</ option >
@@ -511,7 +512,7 @@ <h3 class="card-title">Project Breakdown</h3>
511512 const todayObjInit = new Date ( ) ;
512513 const lastWeekObjInit = new Date ( ) ;
513514 lastWeekObjInit . setDate ( todayObjInit . getDate ( ) - 6 ) ;
514- document . getElementById ( 'date-from' ) . value = lastWeekObjInit . toISOString ( ) . split ( 'T' ) [ 0 ] ;
515+ document . getElementById ( 'date-from' ) . value = todayObjInit . toISOString ( ) . split ( 'T' ) [ 0 ] ;
515516 document . getElementById ( 'date-to' ) . value = todayObjInit . toISOString ( ) . split ( 'T' ) [ 0 ] ;
516517
517518 const presetSelect = document . getElementById ( 'date-preset' ) ;
@@ -919,9 +920,10 @@ <h3 class="card-title">Project Breakdown</h3>
919920 metrics . projectData [ pName ] += taskTimeInRange ;
920921 }
921922
922- // count tasks that had activity OR were completed (in range)
923+ // count tasks that had activity OR were completed OR are due (in range)
923924 const taskCompletedInRange = task . isDone && task . doneOn && dateRange . includes ( new Date ( task . doneOn ) . toISOString ( ) . split ( 'T' ) [ 0 ] ) ;
924- if ( taskTimeInRange > 0 || taskCompletedInRange ) {
925+ const taskDueInRange = task . dueDay && dateRange . includes ( task . dueDay ) ;
926+ if ( taskTimeInRange > 0 || taskCompletedInRange || taskDueInRange ) {
925927 metrics . totalTasks ++ ;
926928 if ( taskCompletedInRange ) {
927929 metrics . totalCompleted ++ ;
0 commit comments