diff options
Diffstat (limited to 'ihatemoney/run.py')
| -rw-r--r-- | ihatemoney/run.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ihatemoney/run.py b/ihatemoney/run.py index 0f32dfb..1d2a575 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, format_currency from flask_mail import Mail @@ -150,8 +151,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)) # Undocumented currencyformat filter from flask_babel is forwarding to Babel format_currency # We overwrite it to remove the currency sign ยค when there is no currency |
