@@ -13,7 +13,7 @@ import type Owner from '@ember/owner';
13
13
import { tracked } from ' @glimmer/tracking' ;
14
14
import { TrackedMap } from ' tracked-built-ins' ;
15
15
import { restartableTask } from ' ember-concurrency' ;
16
- import { format , startOfWeek } from ' date-fns' ;
16
+ import { format , startOfWeek , endOfWeek } from ' date-fns' ;
17
17
18
18
const dateFormat = ` yyyy-MM-dd ` ;
19
19
@@ -452,13 +452,32 @@ class CrmAppTemplate extends Component<typeof CrmApp> {
452
452
break ;
453
453
case ' Due this week' :
454
454
const dueThisWeek = startOfWeek (today , { weekStartsOn: 1 });
455
+ const endOfThisWeek = endOfWeek (today , { weekStartsOn: 1 });
455
456
const formattedDueThisWeek = format (dueThisWeek , dateFormat );
457
+ const formattedEndOfThisWeek = format (endOfThisWeek , dateFormat );
456
458
taskFilter = [
457
- { range: { ' dateRange.start' : { gt: formattedDueThisWeek } } },
459
+ {
460
+ range: {
461
+ ' dateRange.end' : {
462
+ gte: formattedDueThisWeek ,
463
+ lte: formattedEndOfThisWeek ,
464
+ },
465
+ },
466
+ },
458
467
];
459
468
break ;
460
469
case ' High Priority' :
461
- taskFilter = [{ eq: { ' priority.label' : ' High' } }];
470
+ taskFilter = [
471
+ {
472
+ not: { eq: { ' priority.label' : ' Lowest' } },
473
+ },
474
+ {
475
+ not: { eq: { ' priority.label' : ' Low' } },
476
+ },
477
+ {
478
+ not: { eq: { ' priority.label' : ' Medium' } },
479
+ },
480
+ ];
462
481
break ;
463
482
case ' Unassigned' :
464
483
taskFilter = [{ eq: { ' assignee.id' : null } }];
0 commit comments