File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
plugin/src/data/transformations Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -465,6 +465,30 @@ describe("group by date", () => {
465465 } ,
466466 ] ,
467467 } ,
468+ {
469+ description : "should group tasks on same due date but different times together" ,
470+ input : [
471+ makeTask ( "a" , {
472+ due : makeDueDate ( "2024-01-12" ) ,
473+ } ) ,
474+ makeTask ( "b" , {
475+ due : makeDueDate ( "2024-01-12T09:00:00" ) ,
476+ } ) ,
477+ ] ,
478+ expected : [
479+ {
480+ header : "Jan 12 ‧ Friday" ,
481+ tasks : [
482+ makeTask ( "a" , {
483+ due : makeDueDate ( "2024-01-12" ) ,
484+ } ) ,
485+ makeTask ( "b" , {
486+ due : makeDueDate ( "2024-01-12T09:00:00" ) ,
487+ } ) ,
488+ ] ,
489+ } ,
490+ ] ,
491+ } ,
468492 ] ;
469493
470494 for ( const tc of testcases ) {
Original file line number Diff line number Diff line change @@ -154,7 +154,8 @@ function groupByDate(tasks: Task[]): GroupedTasks[] {
154154 return "Overdue" ;
155155 }
156156
157- return task . due . date ;
157+ // Discard any time component for grouping purposes
158+ return task . due . date . split ( "T" ) [ 0 ] ;
158159 } ) ;
159160 const groups = Array . from ( dates . entries ( ) ) ;
160161 groups . sort ( ( a , b ) => {
You can’t perform that action at this time.
0 commit comments