summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-11 17:15:54 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-09-11 17:15:54 +0000
commit6d0aed1f4438b48acb79a48aad08d3c5dab8acf4 (patch)
tree3f71d71460ce59533c971d9187ccb8ab91a5b6a6 /app/helpers
parenta3d0e82552e09f7f74fd0455306e451e1af02739 (diff)
downloadredmine-6d0aed1f4438b48acb79a48aad08d3c5dab8acf4.tar.gz
redmine-6d0aed1f4438b48acb79a48aad08d3c5dab8acf4.zip
Set the first day of week in the date picker according to settings (#11814).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10372 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 180a512dc..b2ea9552c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1095,8 +1095,12 @@ 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
+
tags = javascript_tag(
- "var datepickerOptions={dateFormat: 'yy-mm-dd', " +
+ "var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
path_to_image('/images/calendar.png') +
"', showButtonPanel: true};")