Fix #63: The week_start is different from WakaTime

This commit is contained in:
Hong-ryul Jung 2021-06-23 01:44:44 +09:00
parent 30896489cb
commit 4aeea1e94b
2 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ jobs:
3. Go to your repo secrets by hitting `Settings => Secrets` tab in your profile repo. You can also enter the url https://github.com/USERNAME/USERNAME/settings/secrets . Please replace the `USERNAME` with your own username. 3. Go to your repo secrets by hitting `Settings => Secrets` tab in your profile repo. You can also enter the url https://github.com/USERNAME/USERNAME/settings/secrets . Please replace the `USERNAME` with your own username.
4. Create a new `Secret`. `Name`: `WAKATIME_API_KEY`, `Value`: Paste the Wakatime API key here. 4. Create a new `Secret`. `Name`: `WAKATIME_API_KEY`, `Value`: Paste the Wakatime API key here.
<img width="1241" alt="Screen Shot 2021-05-30 at 21 44 41" src="https://user-images.githubusercontent.com/31362988/120106631-71956680-c190-11eb-84a8-95ff780738da.png"> <img width="1241" alt="Screen Shot 2021-05-30 at 21 44 41" src="https://user-images.githubusercontent.com/31362988/120106631-71956680-c190-11eb-84a8-95ff780738da.png">
If you don't know what is the key, please go to [Account Settings in WakaTime](https://wakatime.com/settings/account) to find your API Key there. If you don't know what is the key, please go to [Account Settings in WakaTime](https://wakatime.com/settings/account) to find your API Key there.
5. Add a comment to your `README.md` like this: 5. Add a comment to your `README.md` like this:
@ -153,7 +153,7 @@ Since this project is contained all within one file, 'main.py'. You can simply a
`SHOW_TITLE` flag can be set to true if you want to display the week number and days in the readme, by default it will be false. Here is an example output with `SHOW_TITLE` set to true. `SHOW_TITLE` flag can be set to true if you want to display the week number and days in the readme, by default it will be false. Here is an example output with `SHOW_TITLE` set to true.
```text ```text
Week: 10 July, 2020 - 17 July, 2020 Week: 11 July, 2020 - 17 July, 2020
Python 8 hrs 52 mins ███████████████████░░░░░░ 75.87 % Python 8 hrs 52 mins ███████████████████░░░░░░ 75.87 %
Go 1 hr 15 mins ██░░░░░░░░░░░░░░░░░░░░░░░ 10.79 % Go 1 hr 15 mins ██░░░░░░░░░░░░░░░░░░░░░░░ 10.79 %
Markdown 52 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 07.43 % Markdown 52 mins █░░░░░░░░░░░░░░░░░░░░░░░░ 07.43 %

View File

@ -27,7 +27,7 @@ blocks = os.getenv("INPUT_BLOCKS")
def this_week() -> str: def this_week() -> str:
'''Returns a week streak''' '''Returns a week streak'''
week_end = datetime.datetime.today() - datetime.timedelta(days=1) week_end = datetime.datetime.today() - datetime.timedelta(days=1)
week_start = week_end - datetime.timedelta(days=7) week_start = week_end - datetime.timedelta(days=6)
print("Week header created") print("Week header created")
return f"Week: {week_start.strftime('%d %B, %Y')} - {week_end.strftime('%d %B, %Y')}" return f"Week: {week_start.strftime('%d %B, %Y')} - {week_end.strftime('%d %B, %Y')}"