You've already forked wakapi-readme-stats
feature: Fix timezone
This commit is contained in:
@@ -31,12 +31,14 @@ async def get_waka_time_stats(repositories: Dict, commit_dates: Dict) -> str:
|
||||
stats = str()
|
||||
|
||||
data = await DM.get_remote_json("waka_latest")
|
||||
time_zone = data["data"]["timezone"] if "timezone" in data["data"] else "America/New_York"
|
||||
|
||||
if data is None:
|
||||
DBM.p("WakaTime data unavailable!")
|
||||
return stats
|
||||
if EM.SHOW_COMMIT or EM.SHOW_DAYS_OF_WEEK: # if any on flag is turned on then we need to calculate the data and print accordingly
|
||||
DBM.i("Adding user commit day time info...")
|
||||
stats += f"{await make_commit_day_time_list(data['data']['timezone'], repositories, commit_dates)}\n\n"
|
||||
stats += f"{await make_commit_day_time_list(time_zone, repositories, commit_dates)}\n\n"
|
||||
|
||||
if EM.SHOW_TIMEZONE or EM.SHOW_LANGUAGE or EM.SHOW_EDITORS or EM.SHOW_PROJECTS or EM.SHOW_OS:
|
||||
no_activity = FM.t("No Activity Tracked This Week")
|
||||
@@ -44,7 +46,6 @@ async def get_waka_time_stats(repositories: Dict, commit_dates: Dict) -> str:
|
||||
|
||||
if EM.SHOW_TIMEZONE:
|
||||
DBM.i("Adding user timezone info...")
|
||||
time_zone = data["data"]["timezone"]
|
||||
stats += f"🕑︎ {FM.t('Timezone')}: {time_zone}\n\n"
|
||||
|
||||
if EM.SHOW_LANGUAGE:
|
||||
|
||||
Reference in New Issue
Block a user