diff --git a/ihatemoney/history.py b/ihatemoney/history.py index 9dda3de6..72403202 100644 --- a/ihatemoney/history.py +++ b/ihatemoney/history.py @@ -82,7 +82,7 @@ def get_history(project, human_readable_names=True): object_str = describe_version(version) common_properties = { - "time": version.transaction.issued_at.strftime("%Y-%m-%dT%H:%M:%SZ"), + "time": version.transaction.issued_at, "operation_type": version.operation_type, "object_type": object_type, "object_desc": object_str, diff --git a/ihatemoney/run.py b/ihatemoney/run.py index c4b53234..2f6d089b 100644 --- a/ihatemoney/run.py +++ b/ihatemoney/run.py @@ -2,6 +2,7 @@ import os import os.path import warnings +from babel.dates import LOCALTZ from flask import Flask, g, render_template, request, session from flask_babel import Babel from flask_mail import Mail @@ -146,8 +147,10 @@ def create_app( app.jinja_env.globals["locale_from_iso"] = locale_from_iso app.jinja_env.filters["minimal_round"] = minimal_round - # Translations - babel = Babel(app) + # Translations and time zone (used to display dates). The timezone is + # taken from the BABEL_DEFAULT_TIMEZONE settings, and falls back to + # the local timezone of the server OS by using LOCALTZ. + babel = Babel(app, default_timezone=str(LOCALTZ)) @babel.localeselector def get_locale(): diff --git a/ihatemoney/templates/history.html b/ihatemoney/templates/history.html index 1ac3284f..b001cdb7 100644 --- a/ihatemoney/templates/history.html +++ b/ihatemoney/templates/history.html @@ -177,7 +177,7 @@
{% for event in history %}