We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e0a400 commit 1632c08Copy full SHA for 1632c08
pkg/models/priority.go
@@ -5,3 +5,30 @@ const (
5
PriorityImportant string = "IMPORTANT"
6
PriorityInformational string = "INFORMATIONAL"
7
)
8
+
9
+var priorityToInt = map[string]int{
10
+ PriorityUrgent: 0,
11
+ PriorityImportant: 1,
12
+ PriorityInformational: 2,
13
+}
14
15
+func ComparePriority(priority1, priority2 string) int {
16
+ val1, ok1 := priorityToInt[priority1]
17
+ val2, ok2 := priorityToInt[priority2]
18
19
+ if !ok1 && !ok2 {
20
+ return 0
21
+ } else if !ok1 {
22
+ return -1
23
+ } else if !ok2 {
24
+ return 1
25
+ }
26
27
+ if val1 < val2 {
28
29
+ } else if val1 > val2 {
30
31
+ } else {
32
33
34
0 commit comments