mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-15 08:46:34 +01:00
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:
parent
183523f45a
commit
dd5b479c5d
6 changed files with 10 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue