summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-10-05 09:36:16 +0000
committerthomascube <thomas@roundcube.net>2011-10-05 09:36:16 +0000
commit537c394302df13e7623a36b28b11caceeaaa75b2 (patch)
tree015360eb1140122be8aa165802d6b4cc9e1b6b25 /program/js
parent4aafd99f2d174672ef0923a246972aa04b9b9abd (diff)
Attach jquery UI date pickers to contact fields of type 'date'
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js
index d2760b439..3ddd55862 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -4146,6 +4146,21 @@ function rcube_webmail()
this.selectedIndex = 0;
});
+ // enable date pickers on date fields
+ if ($.datepicker && this.env.date_format) {
+ $.datepicker.setDefaults({
+ dateFormat: this.env.date_format,
+ changeMonth: true,
+ changeYear: true,
+ yearRange: '-100:+10',
+ showOtherMonths: true,
+ selectOtherMonths: true,
+ monthNamesShort: this.env.month_names,
+ onSelect: function(dateText) { $(this).focus().val(dateText) }
+ });
+ $('input.datepicker').datepicker();
+ }
+
$("input[type='text']:visible").first().focus();
};
@@ -4401,6 +4416,9 @@ function rcube_webmail()
.appendTo(cell);
this.init_edit_field(col, input);
+
+ if (colprop.type == 'date' && $.datepicker)
+ input.datepicker();
}
else if (colprop.type == 'composite') {
var childcol, cp, first, templ, cols = [], suffices = [];