Filter routine upcoming categories
This commit is contained in:
@@ -571,6 +571,9 @@ func filterUpcomingAssignments(assignments []Assignment, now time.Time, days int
|
||||
var filtered []Assignment
|
||||
for _, assignment := range assignments {
|
||||
if !assignment.DueDate.Before(start) && !assignment.DueDate.After(end) {
|
||||
if isExcludedUpcomingAssignment(assignment) {
|
||||
continue
|
||||
}
|
||||
filtered = append(filtered, assignment)
|
||||
}
|
||||
}
|
||||
@@ -737,6 +740,15 @@ func isRevisionStatus(status string) bool {
|
||||
return strings.Contains(status, "revision") || strings.Contains(status, "revise")
|
||||
}
|
||||
|
||||
func isExcludedUpcomingAssignment(assignment Assignment) bool {
|
||||
category := strings.ToLower(strings.TrimSpace(assignment.Category))
|
||||
title := strings.ToLower(strings.TrimSpace(assignment.Title))
|
||||
if strings.Contains(category, "preparedness") || strings.Contains(title, "preparedness") {
|
||||
return true
|
||||
}
|
||||
return strings.Contains(category, "r.i.c.e")
|
||||
}
|
||||
|
||||
func inferAssignmentDate(monthDay string, now time.Time) time.Time {
|
||||
return inferDate(monthDay, now, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user