-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdates.py
37 lines (28 loc) · 1.04 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
from __future__ import print_function
import build_event
# import datetime
# import pytz
# SEM_BEGIN = datetime.datetime.now(pytz.timezone('Asia/Kolkata'))
# SEM BEGIN, and MID_TERM_BEGIN are one day before due to weird calculations
SEM_BEGIN = build_event.generateIndiaTime(2024, 1, 2, 0, 0)
MID_TERM_BEGIN = build_event.generateIndiaTime(2024, 2, 15, 0, 0)
MID_TERM_END = build_event.generateIndiaTime(2024, 2, 23, 0, 0)
END_TERM_BEGIN = build_event.generateIndiaTime(2024, 4, 18, 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")
import os
os._exit(1)
def get_dates():
"""
Returns a list of lists denoting the time periods of working days
"""
return [[SEM_BEGIN, MID_TERM_BEGIN], [MID_TERM_END, END_TERM_BEGIN]]