Closed yozachar closed 4 years ago
@athul
Merge branch 'master' of https://github.com/joe733/waka-readme
Why does this commit appear automatically? I amended a commit, is that why it's happening?
Thanks for taking a look! But I don't think this will work when the month/year rolls over. For the first 7 days of a month, week_start will be < 0 and week_end will be in the next month. Probably it'll be easiest to just display the full date range like so:
def this_week():
'''Returns a week's streak'''
week_end = datetime.datetime.today() - datetime.timedelta(days=1)
week_start = week_end - datetime.timedelta(days=7)
return f"Week: {week_start.strftime('%d %B, %Y')} - {week_end.strftime('%d %B, %Y')}"
Thanks for taking a look! But I don't think this will work when the month/year rolls over. For the first 7 days of a month, week_start will be < 0 and week_end will be in the next month. Probably it'll be easiest to just display the full date range like so:
def this_week(): '''Returns a week's streak''' week_end = datetime.datetime.today() - datetime.timedelta(days=1) week_start = week_end - datetime.timedelta(days=7) return f"Week: {week_start.strftime('%d %B, %Y')} - {week_end.strftime('%d %B, %Y')}"
You're right! I missed it 🤦🏻♂️.
Fixed it.
Thanks @rajitbanerjee and @joe733 for looking on this and the fix. There is mistake on my side too since I was unable to run the API call and verify the week.
Thanks a ton to the both of you 😍
@rajitbanerjee mentions in #7