unless @calendar_headers_tags_included
@calendar_headers_tags_included = true
content_for :header_tags do
+ start_of_week = case Setting.start_of_week.to_i
+ when 1
+ 'Calendar._FD = 1;' # Monday
+ when 7
+ 'Calendar._FD = 0;' # Sunday
+ else
+ '' # use language
+ end
+
javascript_include_tag('calendar/calendar') +
javascript_include_tag("calendar/lang/calendar-#{current_language.to_s.downcase}.js") +
+ javascript_tag(start_of_week) +
javascript_include_tag('calendar/calendar-setup') +
stylesheet_link_tag('calendar')
end
<p><label><%= l(:setting_default_language) %></label>
<%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p>
+<p><label><%= l(:setting_start_of_week) %></label>
+<%= select_tag 'settings[start_of_week]', options_for_select( [[l(:label_language_based), ''], [day_name(1),'1'], [day_name(7),'7']] , Setting.start_of_week) %></p>
+
<p><label><%= l(:setting_date_format) %></label>
<%= select_tag 'settings[date_format]', options_for_select( [[l(:label_language_based), '']] + Setting::DATE_FORMATS.collect {|f| [Date.today.strftime(f), f]}, Setting.date_format) %></p>
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
setting_issue_done_ratio: Calculate the issue done ratio with
setting_issue_done_ratio_issue_field: Use the issue field
setting_issue_done_ratio_issue_status: Use the issue status
+ setting_start_of_week: Start calendars on
permission_add_project: Create project
permission_edit_project: Edit project
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
field_active: Actif
enumeration_system_activity: Activité système
setting_gravatar_default: Default Gravatar image
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
notice_issue_done_ratios_updated: Issue done ratios updated.
error_workflow_copy_source: Please select a source tracker or role
label_update_issue_done_ratios: Update issue done ratios
+ setting_start_of_week: Start calendars on
default: 0
gravatar_default:
default: ''
+start_of_week:
+ default: ''
# 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