You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.8 KiB

9 years ago
  1. /*
  2. OpenERP, Open Source Management Solution
  3. This module copyright (C) 2015 Savoir-faire Linux
  4. (<http://www.savoirfairelinux.com>).
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU Affero General Public License as
  7. published by the Free Software Foundation, either version 3 of the
  8. License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU Affero General Public License for more details.
  13. You should have received a copy of the GNU Affero General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. /*global openerp, _, $ */
  17. openerp.web_widget_datepicker_options = function (instance) {
  18. "use strict";
  19. instance.web.form.FieldDatetime.include({
  20. initialize_content: function() {
  21. this._super();
  22. var self = this;
  23. if (this.datewidget) {
  24. if (typeof this.options.datepicker === 'object') {
  25. $.map(this.options.datepicker, function(value, key) {
  26. self.datewidget.picker('option', key, value);
  27. });
  28. }
  29. }
  30. }
  31. });
  32. instance.web.form.FieldDate.include({
  33. initialize_content: function() {
  34. this._super();
  35. var self = this;
  36. if (this.datewidget) {
  37. if (typeof this.options.datepicker === 'object') {
  38. $.map(this.options.datepicker, function(value, key) {
  39. self.datewidget.picker('option', key, value);
  40. });
  41. }
  42. }
  43. }
  44. });
  45. };