From 6fe52c9012819e68982a38d5b6624fac295b9e7e Mon Sep 17 00:00:00 2001 From: Bruno Boi Date: Fri, 15 Oct 2021 09:03:55 +0000 Subject: [PATCH] [FIX] web: adjust FullCalendar for luxon v2 See preceding commit closes odoo/odoo#78797 Signed-off-by: Aaron Bohy (aab) --- .../web/static/lib/fullcalendar/luxon/main.js | 83 ++++++++++--------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/addons/web/static/lib/fullcalendar/luxon/main.js b/addons/web/static/lib/fullcalendar/luxon/main.js index 88e3976c7ae..32daa762b3a 100644 --- a/addons/web/static/lib/fullcalendar/luxon/main.js +++ b/addons/web/static/lib/fullcalendar/luxon/main.js @@ -10,44 +10,44 @@ Docs & License: https://fullcalendar.io/ (global = global || self, factory(global.FullCalendarLuxon = {}, global.luxon, global.FullCalendar)); }(this, function (exports, luxon, core) { 'use strict'; - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. All rights reserved. - Licensed under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of the - License at http://www.apache.org/licenses/LICENSE-2.0 - - THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED - WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, - MERCHANTABLITY OR NON-INFRINGEMENT. - - See the Apache Version 2.0 License for specific language governing permissions - and limitations under the License. - ***************************************************************************** */ - /* global Reflect, Promise */ - - var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - - function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - - var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); }; function toDateTime(date, calendar) { @@ -63,7 +63,7 @@ Docs & License: https://fullcalendar.io/ if (!(calendar instanceof core.Calendar)) { throw new Error('must supply a Calendar instance'); } - return luxon.Duration.fromObject(__assign({}, duration, { locale: calendar.dateEnv.locale.codes[0] })); + return luxon.Duration.fromObject(__assign({}, duration), { locale: calendar.dateEnv.locale.codes[0] }); } var LuxonNamedTimeZone = /** @class */ (function (_super) { __extends(LuxonNamedTimeZone, _super); @@ -106,8 +106,6 @@ Docs & License: https://fullcalendar.io/ } function arrayToLuxon(arr, timeZone, locale) { return luxon.DateTime.fromObject({ - zone: timeZone, - locale: locale, year: arr[0], month: arr[1] + 1, day: arr[2], @@ -115,6 +113,9 @@ Docs & License: https://fullcalendar.io/ minute: arr[4], second: arr[5], millisecond: arr[6] + }, { + zone: timeZone, + locale: locale, }); } function parseCmdStr(cmdStr) {