forked from metakgp/gyft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdates.py
40 lines (30 loc) · 1.02 KB
/
dates.py
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
from __future__ import print_function
import build_event
import datetime
import pytz
import sys
# SEM_BEGIN=datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
SEM_BEGIN=build_event.generateIndiaTime(2018, 7, 17, 0, 0)
MID_TERM_BEGIN=build_event.generateIndiaTime(2018, 9, 17, 0, 0)
MID_TERM_END=build_event.generateIndiaTime(2018, 9, 26, 23, 59)
END_TERM_BEGIN=build_event.generateIndiaTime(2018, 11, 16, 0, 0)
## Sanity check
sanity = [
SEM_BEGIN < MID_TERM_BEGIN,
MID_TERM_BEGIN < MID_TERM_END,
MID_TERM_END < END_TERM_BEGIN
]
# check if anything is False
sanity_check = [item for item in sanity if not item]
if len(sanity_check) > 0:
print("Check the dates you have entered")
print("Note: SEM_BEGIN < MID_TERM_BEGIN < MID_TERM_END < END_TERM_BEGIN")
sys.exit(1)
'''
Returns a list of lists denoting the time periods of working days
'''
def get_dates():
return [
[ SEM_BEGIN, MID_TERM_BEGIN ],
[ MID_TERM_END, END_TERM_BEGIN ]
]