From 5caceec57becf1ba244f496bc282941b7d695135 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 29 Sep 2020 16:22:34 +0200 Subject: [PATCH] WIP: debug fullcalendar with webpack see https://stackoverflow.com/questions/44220534/uncaught-typeerror-cannot-read-property-hastime-of-undefined --- .../javascript/controllers/admin/calendar.js | 4 ++-- .../src/javascript/services/calendar.js | 2 +- package.json | 4 ++-- yarn.lock | 23 ++++++++++--------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/frontend/src/javascript/controllers/admin/calendar.js b/app/frontend/src/javascript/controllers/admin/calendar.js index 28df8e773..3975b9330 100644 --- a/app/frontend/src/javascript/controllers/admin/calendar.js +++ b/app/frontend/src/javascript/controllers/admin/calendar.js @@ -57,7 +57,7 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state slotDuration: BASE_SLOT, snapDuration: BOOKING_SNAP, selectable: true, - selecHelper: true, + selectHelper: true, minTime: moment.duration(moment(bookingWindowStart.setting.value).format('HH:mm:ss')), maxTime: moment.duration(moment(bookingWindowEnd.setting.value).format('HH:mm:ss')), select (start, end, jsEvent, view) { @@ -69,7 +69,7 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state eventRender (event, element, view) { return eventRenderCb(event, element, view); }, - viewRender(view, element) { + viewRender (view, element) { return viewRenderCb(view, element); }, loading (isLoading, view) { diff --git a/app/frontend/src/javascript/services/calendar.js b/app/frontend/src/javascript/services/calendar.js index 83714623a..531ca8b9e 100644 --- a/app/frontend/src/javascript/services/calendar.js +++ b/app/frontend/src/javascript/services/calendar.js @@ -11,7 +11,7 @@ Application.Services.factory('CalendarConfig', [() => const defaultOptions = { timezone: Fablab.timezone, - lang: Fablab.fullcalendar_locale, + locale: Fablab.fullcalendar_locale, header: { left: 'month agendaWeek', center: 'title', diff --git a/package.json b/package.json index a28191ddf..7feb31bff 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "angular-translate-interpolation-messageformat": "2.18", "angular-translate-loader-partial": "2.18", "angular-ui-bootstrap": "1.2.5", - "angular-ui-calendar": "^1.0.2", + "angular-ui-calendar": "https://github.com/sophilabs-forks/ui-calendar.git#master", "angular-ui-codemirror": "^0.3.0", "angular-ui-tour": "https://github.com/Ross-Byrne/angular-ui-tour.git#master", "angular-unsavedchanges": "0.2", @@ -72,7 +72,7 @@ "codemirror": "^4.8.0", "d3": "3.5", "elasticsearch-browser": "3.1", - "fullcalendar": "2.9.1", + "fullcalendar": "3.3.1", "holderjs": "2.6", "jasny-bootstrap": "3.1", "jquery": ">=3.5.0", diff --git a/yarn.lock b/yarn.lock index 693caecc5..3b3fc588e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1346,10 +1346,11 @@ angular-ui-bootstrap@1.2.5: resolved "https://registry.yarnpkg.com/angular-ui-bootstrap/-/angular-ui-bootstrap-1.2.5.tgz#b0c1eff0bf3b7a65668984a1b81820a90dc60995" integrity sha1-sMHv8L87emVmiYShuBggqQ3GCZU= -angular-ui-calendar@^1.0.2: +"angular-ui-calendar@https://github.com/sophilabs-forks/ui-calendar.git#master": version "1.0.2" - resolved "https://registry.yarnpkg.com/angular-ui-calendar/-/angular-ui-calendar-1.0.2.tgz#fa271057425572efaadf6660243cc33cb99f33c1" - integrity sha1-+icQV0JVcu+q32ZgJDzDPLmfM8E= + resolved "https://github.com/sophilabs-forks/ui-calendar.git#21c4d834cb82f6f4f4c6417669970ff02e193c27" + dependencies: + fullcalendar "~3.3.x" angular-ui-codemirror@^0.3.0: version "0.3.0" @@ -3896,13 +3897,13 @@ fstream@^1.0.0, fstream@^1.0.12: mkdirp ">=0.5 0" rimraf "2" -fullcalendar@2.9.1: - version "2.9.1" - resolved "https://registry.yarnpkg.com/fullcalendar/-/fullcalendar-2.9.1.tgz#dd2a84469b627749e47c5dd9fd71f56146e0651b" - integrity sha1-3SqERptid0nkfF3Z/XH1YUbgZRs= +fullcalendar@3.3.1, fullcalendar@~3.3.x: + version "3.3.1" + resolved "https://registry.yarnpkg.com/fullcalendar/-/fullcalendar-3.3.1.tgz#e8d458d64b7dcb5ba70ce890dda2488b8911539a" + integrity sha1-6NRY1kt9y1unDOiQ3aJIi4kRU5o= dependencies: - jquery ">=1.7.1" - moment ">=2.5.0" + jquery "2 - 3" + moment "^2.9.0" function-bind@^1.1.1: version "1.1.1" @@ -4907,7 +4908,7 @@ jquery-ujs@^1.2.2: dependencies: jquery ">=1.8.0" -jquery@>=1.7.1, jquery@>=1.8.0, jquery@>=3.5.0: +"jquery@2 - 3", jquery@>=1.8.0, jquery@>=3.5.0: version "3.5.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.1.tgz#d7b4d08e1bfdb86ad2f1a3d039ea17304717abb5" integrity sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg== @@ -5572,7 +5573,7 @@ moment@2.22, "moment@>=2.8.0 <3.0.0": resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== -moment@>=2.5.0: +moment@^2.9.0: version "2.29.0" resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.0.tgz#fcbef955844d91deb55438613ddcec56e86a3425" integrity sha512-z6IJ5HXYiuxvFTI6eiQ9dm77uE0gyy1yXNApVHqTcnIKfY9tIwEjlzsZ6u1LQXvVgKeTnv9Xm7NDvJ7lso3MtA==