forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperiod.py
More file actions
48 lines (45 loc) · 1.46 KB
/
period.py
File metadata and controls
48 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import graphene
class PeriodEnums(graphene.Enum):
JANUARY = "Jan"
FEBRUARY = "Feb"
MARCH = "Mar"
APRIL = "Apr"
MAY = "May"
JUNE = "Jun"
JULY = "Jul"
AUGUST = "Aug"
SEPTEMBER = "Sept"
OCTOBER = "Oct"
NOVEMBER = "Nov"
DECEMBER = "Dec"
LAST30DAYS = "last30days"
@property
def description(self):
if self == PeriodEnums.JANUARY:
return "The month of January"
elif self == PeriodEnums.FEBRUARY:
return "The month of February"
elif self == PeriodEnums.MARCH:
return "The month of March"
elif self == PeriodEnums.APRIL:
return "The month of April"
elif self == PeriodEnums.MAY:
return "The month of May"
elif self == PeriodEnums.JUNE:
return "The month of June"
elif self == PeriodEnums.JULY:
return "The month of July"
elif self == PeriodEnums.AUGUST:
return "The month of August"
elif self == PeriodEnums.SEPTEMBER:
return "The month of September"
elif self == PeriodEnums.OCTOBER:
return "The month of October"
elif self == PeriodEnums.NOVEMBER:
return "The month of November"
elif self == PeriodEnums.DECEMBER:
return "The month of December"
elif self == PeriodEnums.LAST30DAYS:
return "The last 30 days"
else:
return "Error, this enum value does not exist."