From 7298d3241bea1272ba316c437007d9c07c4ed8b4 Mon Sep 17 00:00:00 2001 From: Marc Schumann Date: Fri, 18 May 2012 14:09:05 +0200 Subject: The calendar widget is not localizable. r/a=LpSolit https://bugzilla.mozilla.org/show_bug.cgi?id=581365 --- js/field.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/field.js b/js/field.js index 0824e2714..4150f8ce4 100644 --- a/js/field.js +++ b/js/field.js @@ -83,9 +83,17 @@ function _errorFor(field, name) { YAHOO.util.Dom.addClass(field, 'validation_error_field'); } -function createCalendar(name) { +/* This function is never to be called directly, but only indirectly + * using template/en/default/global/calendar.js.tmpl, so that localization + * works. For the same reason, if you modify this function's parameter list, + * you need to modify the documentation in said template as well. */ +function createCalendar(name, start_weekday, months_long, weekdays_short) { var cal = new YAHOO.widget.Calendar('calendar_' + name, - 'con_calendar_' + name); + 'con_calendar_' + name, + { START_WEEKDAY: start_weekday, + MONTHS_LONG: months_long, + WEEKDAYS_SHORT: weekdays_short + }); YAHOO.bugzilla['calendar_' + name] = cal; var field = document.getElementById(name); cal.selectEvent.subscribe(setFieldFromCalendar, field, false); -- cgit v1.2.1