Fix first day of the week in datepickers

Fixes #2188
This commit is contained in:
Francis Lachapelle
2013-01-21 12:12:50 -05:00
parent a78d7007d7
commit be459fa946
9 changed files with 37 additions and 9 deletions
@@ -348,14 +348,14 @@ function initTimeWidgets(widgets) {
this.timeWidgets = widgets;
if (widgets['start']['date']) {
jQuery(widgets['start']['date']).closest('.date').datepicker({autoclose: true});
jQuery(widgets['start']['date']).closest('.date').datepicker({autoclose: true, weekStart: firstDayOfWeek});
jQuery(widgets['start']['date']).change(onAdjustTime);
widgets['start']['time'].on("time:change", onAdjustTime);
widgets['start']['time'].addInterface(SOGoTimePickerInterface);
}
if (widgets['end']['date']) {
jQuery(widgets['end']['date']).closest('.date').datepicker({autoclose: true});
jQuery(widgets['end']['date']).closest('.date').datepicker({autoclose: true, weekStart: firstDayOfWeek});
jQuery(widgets['end']['date']).change(onAdjustTime);
widgets['end']['time'].on("time:change", onAdjustTime);
widgets['end']['time'].addInterface(SOGoTimePickerInterface);
+4 -2
View File
@@ -1644,13 +1644,15 @@ document.observe("dom:loaded", onFreeBusyLoadHandler);
function initTimeWidgets(widgets) {
this.timeWidgets = widgets;
jQuery(widgets['start']['date']).closest('.date').datepicker({autoclose: true, position: 'above'});
jQuery(widgets['start']['date']).closest('.date').datepicker(
{ autoclose: true, position: 'above', weekStart: parentvar('firstDayOfWeek') });
jQuery(widgets['start']['date']).change(onAdjustTime);
widgets['start']['time'].on("time:change", onAdjustTime);
widgets['start']['time'].addInterface(SOGoTimePickerInterface);
widgets['start']['time'].setPosition('above');
jQuery(widgets['end']['date']).closest('.date').datepicker({autoclose: true, position: 'above'});
jQuery(widgets['end']['date']).closest('.date').datepicker(
{ autoclose: true, position: 'above', weekStart: parentvar('firstDayOfWeek') });
jQuery(widgets['end']['date']).change(onAdjustTime);
widgets['end']['time'].on("time:change", onAdjustTime);
widgets['end']['time'].addInterface(SOGoTimePickerInterface);
+2 -1
View File
@@ -220,7 +220,8 @@ function initPreferences() {
button = $("enableVacationEndDate");
if (button) {
jQuery("#vacationEndDate_date").closest(".date").datepicker({autoclose: true, position: 'above'});
jQuery("#vacationEndDate_date").closest(".date").datepicker(
{ autoclose: true, position: 'above', weekStart: $('weekStartDay').getValue() });
button.on("click", function(event) {
if (this.checked)
$("vacationEndDate_date").enable();
+2 -1
View File
@@ -396,7 +396,8 @@ function onRecurrenceLoadHandler() {
initializeFormValues();
initializeSelectors();
initializeWindowButtons();
jQuery('#endDate_date').closest('.date').datepicker({autoclose: true});
jQuery('#endDate_date').closest('.date').datepicker(
{ autoclose: true, weekStart: parentvar('firstDayOfWeek') });
escapeAlertMessages();
}
+3 -3
View File
@@ -271,9 +271,9 @@ this.onAdjustDueTime = function(event) {
this.initTimeWidgets = function (widgets) {
this.timeWidgets = widgets;
jQuery(widgets['start']['date']).closest('.date').datepicker({autoclose: true});
jQuery(widgets['due']['date']).closest('.date').datepicker({autoclose: true});
jQuery('#statusTime_date').closest('.date').datepicker({autoclose: true});
jQuery(widgets['start']['date']).closest('.date').datepicker({autoclose: true, weekStart: firstDayOfWeek});
jQuery(widgets['due']['date']).closest('.date').datepicker({autoclose: true, weekStart: firstDayOfWeek});
jQuery('#statusTime_date').closest('.date').datepicker({autoclose: true, weekStart: firstDayOfWeek});
jQuery(widgets['start']['date']).change(onAdjustTime);
widgets['start']['time'].on("time:change", onAdjustDueTime);
+13
View File
@@ -1871,6 +1871,19 @@ function parent$(element) {
return (p ? p.getElementById(element) : null);
}
function parentvar(name) {
var div = $("popupFrame");
if (div)
p = parent;
else if (this.opener)
p = this.opener;
else
p = null;
return (p ? p[name] : null);
}
/* stubs */
function refreshCurrentFolder(id) {
}