-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathutil.py
More file actions
50 lines (40 loc) · 1.12 KB
/
util.py
File metadata and controls
50 lines (40 loc) · 1.12 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
49
50
import datetime
def toDateString(dt):
return dt.strftime("%m/%d/%Y")
def getTimeString(datetime):
hour = datetime.hour
minute = datetime.minute
PM = datetime.hour >= 12
if PM:
hour = hour % 12
if hour == 0:
hour = 12
return str(hour) + ":" + ("0" if minute < 10 else "") + str(minute) + (" PM" if PM else " AM")
def getDateTime(currentDateTime, timeString):
pieces = timeString.split(":")
hourVal = int(pieces[0])
minuteVal = int(pieces[1][0:2])
suffixString = (pieces[1][len(pieces[1])-2:])
PM = suffixString.lower() == "pm"
if PM == True:
if hourVal != 12:
hourVal = hourVal + 12
else:
hourVal = 12
else:
if hourVal != 12:
hourVal = hourVal
else:
hourVal = 0
return currentDateTime.replace(
hour=hourVal, minute=minuteVal, second=0, microsecond=0)
canvWidth = 1400
canvHeight = 850
cellWidth = 200
eventBg = "#3065ba"
taskBg = "#2aa36f"
lateBg = "#b02c42"
eventViewBg = "#fafaa5"
eventViewButtonBg = "#002cbd"
eventViewButtonBgActive = "#003afa"
breakdownBg = "#ffbf91"