summaryrefslogtreecommitdiffstats
path: root/template/en/default/global
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2015-09-25 18:34:42 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2015-09-25 18:34:42 +0200
commitb92f32dd334617e74ab931c1db1801cf1c2897ba (patch)
tree47d93475fb94fab18432cf9a5b2b6b6efc9add0a /template/en/default/global
parentb3abb29f2814bafd69095f3ef91bc40cbe5f866c (diff)
downloadbugzilla-b92f32dd334617e74ab931c1db1801cf1c2897ba.tar.gz
bugzilla-b92f32dd334617e74ab931c1db1801cf1c2897ba.tar.xz
Bug 1201266: Migrate YUI calendar to jQuery
r=gerv
Diffstat (limited to 'template/en/default/global')
-rw-r--r--template/en/default/global/calendar.js.tmpl33
-rw-r--r--template/en/default/global/header.html.tmpl11
2 files changed, 10 insertions, 34 deletions
diff --git a/template/en/default/global/calendar.js.tmpl b/template/en/default/global/calendar.js.tmpl
deleted file mode 100644
index 26f3fa023..000000000
--- a/template/en/default/global/calendar.js.tmpl
+++ /dev/null
@@ -1,33 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
- # License, v. 2.0. If a copy of the MPL was not distributed with this
- # file, You can obtain one at http://mozilla.org/MPL/2.0/.
- #
- # This Source Code Form is "Incompatible With Secondary Licenses", as
- # defined by the Mozilla Public License, v. 2.0.
- #%]
-
-[%# INTERFACE:
- # id: The id of the input field the calendar widget is to be assigned to.
- #%]
-
-[%# This template exists because createCalendar accepts additional parameters
- # which allow for localization. Please see the YUI documentation at
- # http://developer.yahoo.com/yui/calendar/#internationalization for details.
- # As an example, here's what you'd specify as additional parameters to
- # localize for German calendars; replace the ellipsis ("...") by the original
- # parameter (we cannot put it into the example because it'd break this
- # template comment):
- #
- # createCalendar(...
- # /* The weekday the week begins on; 0 is Sunday,
- # * 1 is Monday and so on: */
- # 1,
- # /* Months, full names; first must be January: */
- # ['Januar', 'Februar', 'März', 'April',
- # 'Mai', 'Juni', 'Juli', 'August',
- # 'September', 'Oktober', 'November', 'Dezember'],
- # /* Weekdays, two-letter abbreviations; first must be
- # * Sunday: */
- # ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa']);
- #%]
-createCalendar('[% id FILTER js %]');
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index af9c8b686..6a52e7840 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -44,7 +44,6 @@
[% IF NOT no_yui %]
[% SET yui_css = {
- calendar => 1,
datatable => 1,
button => 1,
} %]
@@ -182,6 +181,16 @@
}
$(document).ready(unhide_language_selector);
+ // This sets the default parameters for all calendar fields.
+ $.datepicker.setDefaults({
+ dateFormat: "yy-mm-dd", // this is the YYYY-MM-DD format
+ showButtonPanel: true, // permits to easily select "Today"
+ // These 3 parameters are useful for localization.
+ firstDay: 0, // 0 = Sunday, 1 = Monday, etc...
+ dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ],
+ monthNames: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
+ });
+
[%# Make some Bugzilla information available to all scripts.
# We don't import every parameter and constant because we
# don't want to add a lot of uncached JS to every page.