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.

60 lines
2.1 KiB

  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. odoo.define('web_widget_datepicker_options', function (require) {
  18. "use strict";
  19. var core = require('web.core');
  20. var DateTimeWidget = require('web.datepicker').DateTimeWidget;
  21. var DateWidget = require('web.datepicker').DateWidget;
  22. DateTimeWidget.include({
  23. start: function(parent, options) {
  24. this._super.apply(this, arguments);
  25. var self = this;
  26. if (this.__parentedParent.options.datepicker) {
  27. var options = this.__parentedParent.options.datepicker;
  28. $.each(options, function(value, key) {
  29. self.options[value] = key;
  30. self.picker[value] = key;
  31. self.picker.options[value] = key;
  32. });
  33. }
  34. },
  35. });
  36. DateWidget.include({
  37. start: function(parent, options) {
  38. this._super.apply(this, arguments);
  39. var self = this;
  40. if (this.__parentedParent.options.datepicker) {
  41. var options = this.__parentedParent.options.datepicker;
  42. $.each(options, function(value, key) {
  43. self.options[value] = key;
  44. self.picker[value] = key;
  45. self.picker.options[value] = key;
  46. });
  47. }
  48. },
  49. });
  50. });