Use user time zone
This commit is contained in:
@ -41,7 +41,7 @@ module Additionals
|
||||
end
|
||||
|
||||
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
|
||||
|
@ -30,7 +30,7 @@ module Additionals
|
||||
pages = WikiPage
|
||||
.includes(:content)
|
||||
.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")
|
||||
o = ''
|
||||
date = nil
|
||||
|
@ -248,7 +248,7 @@ class WikiControllerTest < ActionController::TestCase
|
||||
get :show, project_id: 1, id: @page_name
|
||||
assert_response :success
|
||||
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
|
||||
|
||||
def test_show_issue
|
||||
|
Reference in New Issue
Block a user