Skip to content
Snippets Groups Projects
Commit b6b9be8d authored by Jan Mach's avatar Jan Mach
Browse files

Refactoring: Renamed get_current_utc and get_current_local Jinja template...

Refactoring: Renamed get_current_utc and get_current_local Jinja template helpers to get_datetime_utc and get_datetime_local respectively.

(Redmine issue: #3734)
parent 04f906af
No related branches found
No related tags found
No related merge requests found
......@@ -141,16 +141,16 @@ def _setup_app_core(app):
"""
return flask.Markup(hawat.const.FA_ICONS[icon_name])
def get_current_utc():
def get_datetime_utc():
"""
Get current UTC timestamp.
Get current UTC datetime.
:return: Curent UTC timestamp.
:return: Curent UTC datetime.
:rtype: datetime.datetime
"""
return datetime.datetime.utcnow()
def get_current_local():
def get_datetime_local():
"""
Get current local timestamp.
......@@ -160,9 +160,9 @@ def _setup_app_core(app):
return datetime.datetime.now()
return dict(
get_fa_icon = get_fa_icon,
get_current_utc = get_current_utc,
get_current_local = get_current_local
get_fa_icon = get_fa_icon,
get_datetime_utc = get_datetime_utc,
get_datetime_local = get_datetime_local
)
......@@ -170,7 +170,6 @@ def _setup_app_core(app):
def index():
return flask.render_template('index.html')
#app.teardown_appcontext(hawat.db.db_close)
return app
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment