aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-03 10:38:40 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-05-03 10:38:40 +0200
commit28bcb305d5b05758dceeb7c7cd8ad65c7ec4b477 (patch)
tree79d47c8ce7648f23e1ab9f2d12ceb68704fa5a4a /pyaggr3g470r/views.py
parentRemoved unused variable. (diff)
downloadnewspipe-28bcb305d5b05758dceeb7c7cd8ad65c7ec4b477.tar.gz
newspipe-28bcb305d5b05758dceeb7c7cd8ad65c7ec4b477.tar.bz2
newspipe-28bcb305d5b05758dceeb7c7cd8ad65c7ec4b477.zip
Take into account the client time zone.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index f9a44228..1fb1658c 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -42,7 +42,7 @@ import export
if not conf.ON_HEROKU:
import search as fastsearch
from forms import SigninForm, AddFeedForm, ProfileForm
-from pyaggr3g470r import app, db, allowed_file, babel
+from pyaggr3g470r import app, db, allowed_file, babel, TIME_ZONE
from pyaggr3g470r.models import User, Feed, Article, Role
from pyaggr3g470r.decorators import feed_access_required
@@ -112,7 +112,6 @@ def redirect_url(default='home'):
request.referrer or \
url_for(default)
-
@babel.localeselector
def get_locale():
"""
@@ -121,6 +120,9 @@ def get_locale():
"""
return request.accept_languages.best_match(conf.LANGUAGES.keys())
+@babel.timezoneselector
+def get_timezone():
+ return TIME_ZONE[get_locale()]
#
# Views.
bgstack15