You've already forked wakapi-readme-stats
feat: add updated_date_format option
This commit is contained in:
@@ -97,6 +97,11 @@ inputs:
|
|||||||
description: "Show updated date"
|
description: "Show updated date"
|
||||||
default: "True"
|
default: "True"
|
||||||
|
|
||||||
|
UPDATED_DATE_FORMAT:
|
||||||
|
required: false
|
||||||
|
description: "Updated date format"
|
||||||
|
default: "%d/%m/%Y %H:%M:%S"
|
||||||
|
|
||||||
SHOW_TOTAL_CODE_TIME:
|
SHOW_TOTAL_CODE_TIME:
|
||||||
required: false
|
required: false
|
||||||
description: "Show Total Time you have coded"
|
description: "Show Total Time you have coded"
|
||||||
|
|||||||
3
main.py
3
main.py
@@ -46,6 +46,7 @@ locale = os.getenv('INPUT_LOCALE')
|
|||||||
commit_by_me = os.getenv('INPUT_COMMIT_BY_ME')
|
commit_by_me = os.getenv('INPUT_COMMIT_BY_ME')
|
||||||
ignored_repos_name = str(os.getenv('INPUT_IGNORED_REPOS') or '').replace(' ', '').split(',')
|
ignored_repos_name = str(os.getenv('INPUT_IGNORED_REPOS') or '').replace(' ', '').split(',')
|
||||||
show_updated_date = os.getenv('INPUT_SHOW_UPDATED_DATE')
|
show_updated_date = os.getenv('INPUT_SHOW_UPDATED_DATE')
|
||||||
|
updated_date_format = os.getenv('INPUT_UPDATED_DATE_FORMAT')
|
||||||
commit_message = os.getenv('INPUT_COMMIT_MESSAGE')
|
commit_message = os.getenv('INPUT_COMMIT_MESSAGE')
|
||||||
show_total_code_time = os.getenv('INPUT_SHOW_TOTAL_CODE_TIME')
|
show_total_code_time = os.getenv('INPUT_SHOW_TOTAL_CODE_TIME')
|
||||||
symbol_version = os.getenv('INPUT_SYMBOL_VERSION').strip()
|
symbol_version = os.getenv('INPUT_SYMBOL_VERSION').strip()
|
||||||
@@ -518,7 +519,7 @@ def get_stats(github):
|
|||||||
|
|
||||||
if show_updated_date.lower() in truthy:
|
if show_updated_date.lower() in truthy:
|
||||||
now = datetime.datetime.utcnow()
|
now = datetime.datetime.utcnow()
|
||||||
d1 = now.strftime("%d/%m/%Y %H:%M:%S")
|
d1 = now.strftime(updated_date_format)
|
||||||
stats = stats + "\n Last Updated on " + d1 + " UTC"
|
stats = stats + "\n Last Updated on " + d1 + " UTC"
|
||||||
|
|
||||||
return stats
|
return stats
|
||||||
|
|||||||
Reference in New Issue
Block a user