File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export class Urgency {
11
11
public static calculate ( task : Task ) : number {
12
12
let urgency = 0.0 ;
13
13
14
- if ( task . dueDate !== null && task . dueDate . isValid ( ) ) {
14
+ if ( task . dueDate ? .isValid ( ) ) {
15
15
// Map a range of 21 days to the value 0.2 - 1.0
16
16
const startOfToday = window . moment ( ) . startOf ( 'day' ) ;
17
17
const daysOverdue = Math . round ( startOfToday . diff ( task . dueDate ) / Urgency . milliSecondsPerDay ) ;
@@ -29,13 +29,13 @@ export class Urgency {
29
29
urgency += dueMultiplier * Urgency . dueCoefficient ;
30
30
}
31
31
32
- if ( task . scheduledDate !== null && task . scheduledDate . isValid ( ) ) {
32
+ if ( task . scheduledDate ? .isValid ( ) ) {
33
33
if ( window . moment ( ) . isSameOrAfter ( task . scheduledDate ) ) {
34
34
urgency += 1 * Urgency . scheduledCoefficient ;
35
35
}
36
36
}
37
37
38
- if ( task . startDate !== null && task . startDate . isValid ( ) ) {
38
+ if ( task . startDate ? .isValid ( ) ) {
39
39
if ( window . moment ( ) . isBefore ( task . startDate ) ) {
40
40
urgency += 1 * Urgency . startedCoefficient ;
41
41
}
You can’t perform that action at this time.
0 commit comments