summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-12-13 04:06:55 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-12-13 04:06:55 +0000
commitc31a6719735114c371e5da68eb3787b8713c5360 (patch)
tree21989b6b6a9ec37690b9389bbc0bace573b7400a /lib
parent4fb554e95d69268f0a88996fc09c73c1a4eec57a (diff)
downloadredmine-c31a6719735114c371e5da68eb3787b8713c5360.tar.gz
redmine-c31a6719735114c371e5da68eb3787b8713c5360.zip
Added a setting to configure the day that week start on (Monday or Sunday). (#4363)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3166 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/helpers/calendar.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/redmine/helpers/calendar.rb b/lib/redmine/helpers/calendar.rb
index 3e703ea6d..ec474025b 100644
--- a/lib/redmine/helpers/calendar.rb
+++ b/lib/redmine/helpers/calendar.rb
@@ -65,7 +65,14 @@ module Redmine
# Return the first day of week
# 1 = Monday ... 7 = Sunday
def first_wday
- @first_dow ||= (l(:general_first_day_of_week).to_i - 1)%7 + 1
+ case Setting.start_of_week.to_i
+ when 1
+ @first_dow ||= (1 - 1)%7 + 1
+ when 7
+ @first_dow ||= (7 - 1)%7 + 1
+ else
+ @first_dow ||= (l(:general_first_day_of_week).to_i - 1)%7 + 1
+ end
end
def last_wday