summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-11 17:26:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-11 17:26:42 +0000
commit40302566a8ecc53e485385a032dd9ee44fd84eb7 (patch)
tree1ae70653476ea889adf312a5d9f8afc0806175a9
parent6d0aed1f4438b48acb79a48aad08d3c5dab8acf4 (diff)
downloadredmine-40302566a8ecc53e485385a032dd9ee44fd84eb7.tar.gz
redmine-40302566a8ecc53e485385a032dd9ee44fd84eb7.zip
Code cleanup (#11814).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10373 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b2ea9552c..dc65edabd 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1095,9 +1095,11 @@ module ApplicationHelper
unless @calendar_headers_tags_included
@calendar_headers_tags_included = true
content_for :header_tags do
- # Monday, Sunday, Saturday
- start_of_week = {1 => 1, 7 => 0, 6 => 6}[Setting.start_of_week.to_i] ||
- l(:general_first_day_of_week, :default => '1') # use language
+ start_of_week = Setting.start_of_week
+ start_of_week = l(:general_first_day_of_week, :default => '1') if start_of_week.blank?
+ # Redmine uses 1..7 (monday..sunday) in settings and locales
+ # JQuery uses 0..6 (sunday..saturday), 7 needs to be changed to 0
+ start_of_week = start_of_week.to_i % 7
tags = javascript_tag(
"var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +