fix #584 where the date at the top did not use the users timezone, but the servers timezone

also remove confusing user_time helper
This commit is contained in:
Reinier Balt 2009-04-07 21:34:15 +02:00
parent 183523f45a
commit dd5b479c5d
6 changed files with 10 additions and 14 deletions

View file

@ -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

View file

@ -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 ""