diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-10-05 09:36:16 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-10-05 09:36:16 +0000 |
| commit | df198feaa4b97a87a87eaa1e41b77686af62e88f (patch) | |
| tree | 4934ead98f36dda9121f3776fcf7328c6e45692e /roundcubemail/program/js | |
| parent | fd8fee161edd62de88e5e101e2cc35f44b8c30ac (diff) | |
Attach jquery UI date pickers to contact fields of type 'date'
git-svn-id: https://svn.roundcube.net/trunk@5308 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index d2760b439..3ddd55862 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/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 = []; |
