Use user time zone

This commit is contained in:
Alexander Meindl
2018-02-10 18:30:42 +01:00
parent b9135ec0b7
commit 365c1719e0
3 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ module Additionals
end end
macro :current_weeknumber do |_obj, _args| macro :current_weeknumber do |_obj, _args|
content_tag(:span, Time.zone.today.cweek, class: 'current-date') content_tag(:span, User.current.today.cweek, class: 'current-date')
end end
end end
end end

View File

@ -30,7 +30,7 @@ module Additionals
pages = WikiPage pages = WikiPage
.includes(:content) .includes(:content)
.where(["#{WikiPage.table_name}.wiki_id = ? AND #{WikiContent.table_name}.updated_on > ?", .where(["#{WikiPage.table_name}.wiki_id = ? AND #{WikiContent.table_name}.updated_on > ?",
page.wiki_id, Time.zone.today - days]) page.wiki_id, User.current.today - days])
.order("#{WikiContent.table_name}.updated_on desc") .order("#{WikiContent.table_name}.updated_on desc")
o = '' o = ''
date = nil date = nil

View File

@ -248,7 +248,7 @@ class WikiControllerTest < ActionController::TestCase
get :show, project_id: 1, id: @page_name get :show, project_id: 1, id: @page_name
assert_response :success assert_response :success
assert_template 'show' assert_template 'show'
assert_select 'div.wiki span.current-date', Time.zone.today.cweek.to_s assert_select 'div.wiki span.current-date', User.current.today.cweek.to_s
end end
def test_show_issue def test_show_issue