Skip to content

Commit

Permalink
bugfix in date calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
guanyilun committed Feb 6, 2024
1 parent b432b3e commit d68d8a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def arxiv_url_to_id_and_ver(url):

def get_past_sunday(n=1):
curr = datetime.datetime.now()
if curr.weekday() == 6:
# if we are on a sunday and try to get the past sunday
# here is my definition, past sunday = today in this case
if n == 1 and curr.weekday() == 6:
return curr
while n > 0:
sunday = curr - datetime.timedelta(days=curr.weekday()+1)
Expand Down

0 comments on commit d68d8a4

Please sign in to comment.