bugfixing
This commit is contained in:
parent
b3e57ccbc9
commit
00d999379a
@ -81,11 +81,10 @@ def remove_duplicates(elements):
|
||||
|
||||
def weekday():
|
||||
today = datetime.today()
|
||||
one_day = timedelta(1)
|
||||
yesterday = today - one_day
|
||||
yesterday = today - timedelta(1)
|
||||
|
||||
while yesterday.weekday() >= 5: # 5 = Saturday, 6 = Sunday
|
||||
yesterday -= one_day
|
||||
yesterday -= timedelta(2)
|
||||
|
||||
return yesterday.strftime('%Y-%m-%d')
|
||||
|
||||
@ -94,6 +93,8 @@ today = datetime.today().strftime('%Y-%m-%d')
|
||||
tomorrow = (datetime.today() + timedelta(1))
|
||||
yesterday = weekday()
|
||||
|
||||
print(yesterday, today)
|
||||
|
||||
if tomorrow.weekday() >= 5: # 5 = Saturday, 6 = Sunday
|
||||
tomorrow = tomorrow + timedelta(days=(7 - tomorrow.weekday()))
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user