From dd5b479c5d93ce6d600b13818bd7ddc8bc7f2422 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Tue, 7 Apr 2009 21:34:15 +0200 Subject: [PATCH] fix #584 where the date at the top did not use the users timezone, but the servers timezone also remove confusing user_time helper --- app/helpers/application_helper.rb | 6 +----- app/helpers/todos_helper.rb | 6 +++--- app/views/layouts/mobile.m.erb | 2 +- app/views/layouts/standard.html.erb | 2 +- app/views/preferences/index.html.erb | 6 +++--- app/views/todos/_edit_mobile.rhtml | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ff01fcae..61ad8209 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,10 +2,6 @@ # application. module ApplicationHelper - def user_time - Time.zone.now - end - # Replicates the link_to method but also checks request.request_uri to find # current page. If that matches the url, the link is marked id = "current" # @@ -24,7 +20,7 @@ module ApplicationHelper end def days_from_today(date) - date.in_time_zone.to_date - user_time.to_date + date.in_time_zone.to_date - current_user.time.to_date end # Check due date in comparison to today's date Flag up date appropriately with diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 61e79a8c..8e1aa83e 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -161,11 +161,11 @@ module TodosHelper def staleness_class(item) if item.due || item.completed? return "" - elsif item.created_at < user_time - (prefs.staleness_starts * 3).days + elsif item.created_at < current_user.time - (prefs.staleness_starts * 3).days return " stale_l3" - elsif item.created_at < user_time - (prefs.staleness_starts * 2).days + elsif item.created_at < current_user.time - (prefs.staleness_starts * 2).days return " stale_l2" - elsif item.created_at < user_time - (prefs.staleness_starts).days + elsif item.created_at < current_user.time - (prefs.staleness_starts).days return " stale_l1" else return "" diff --git a/app/views/layouts/mobile.m.erb b/app/views/layouts/mobile.m.erb index 3ee740a5..d23a83e3 100644 --- a/app/views/layouts/mobile.m.erb +++ b/app/views/layouts/mobile.m.erb @@ -14,7 +14,7 @@ <% if !(@new_mobile || @edit_mobile) if !@prefs.nil? -%>

<%= @down_count %> <%= - user_time.strftime(@prefs.title_date_format) -%>

+ current_user.time.strftime(@prefs.title_date_format) -%>