Merge pull request #8 from joe733/master
fix: Changed to week streak instead for week of the year
This commit is contained in:
commit
96f680b05f
10
main.py
10
main.py
@ -19,12 +19,10 @@ waka_key = os.getenv('INPUT_WAKATIME_API_KEY')
|
|||||||
ghtoken = os.getenv('INPUT_GH_TOKEN')
|
ghtoken = os.getenv('INPUT_GH_TOKEN')
|
||||||
|
|
||||||
def this_week():
|
def this_week():
|
||||||
'''Returns current week span'''
|
'''Returns a week's streak'''
|
||||||
week_number = datetime.date.today().isocalendar()[1]
|
week_end = datetime.datetime.today() - datetime.timedelta(days=1)
|
||||||
month = datetime.date.today().strftime('%B')
|
week_start = week_end - datetime.timedelta(days=7)
|
||||||
week_start = datetime.datetime.today().day - datetime.datetime.today().weekday()
|
return f"Week: {week_start.strftime('%d %B, %Y')} - {week_end.strftime('%d %B, %Y')}"
|
||||||
week_end = week_start + 5
|
|
||||||
return f"Week #{week_number} : {month} {week_start} - {week_end}"
|
|
||||||
|
|
||||||
def make_graph(percent: float):
|
def make_graph(percent: float):
|
||||||
'''Make progress graph from API graph'''
|
'''Make progress graph from API graph'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user