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
This commit is contained in:
Eric Davis
2009-12-13 04:06:55 +00:00
parent 4fb554e95d
commit c31a671973
39 changed files with 58 additions and 1 deletions
+8 -1
View File
@@ -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