set default issue start/due datepicker from due/start date (#14024)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11883 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -1075,6 +1075,7 @@ module ApplicationHelper
|
||||
|
||||
def include_calendar_headers_tags
|
||||
unless @calendar_headers_tags_included
|
||||
tags = javascript_include_tag("datepicker")
|
||||
@calendar_headers_tags_included = true
|
||||
content_for :header_tags do
|
||||
start_of_week = Setting.start_of_week
|
||||
@@ -1082,12 +1083,13 @@ module ApplicationHelper
|
||||
# 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(
|
||||
tags << javascript_tag(
|
||||
"var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: #{start_of_week}, " +
|
||||
"showOn: 'button', buttonImageOnly: true, buttonImage: '" +
|
||||
path_to_image('/images/calendar.png') +
|
||||
"', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true, changeMonth: true, changeYear: true};")
|
||||
"', showButtonPanel: true, showWeek: true, showOtherMonths: true, " +
|
||||
"selectOtherMonths: true, changeMonth: true, changeYear: true, " +
|
||||
"beforeShow: beforeShowDatePicker};")
|
||||
jquery_locale = l('jquery.locale', :default => current_language.to_s)
|
||||
unless jquery_locale == 'en'
|
||||
tags << javascript_include_tag("i18n/jquery.ui.datepicker-#{jquery_locale}.js")
|
||||
|
||||
Reference in New Issue
Block a user