From e24fca7f9de65d86514a56d37dd0f82d432bc265 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Mon, 9 Jan 2023 11:37:58 +0100 Subject: [PATCH] (bug) event is over before the end --- CHANGELOG.md | 1 + app/frontend/src/javascript/controllers/events.js.erb | 3 ++- app/frontend/templates/events/show.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49028542f..f0ae40bec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab-manager - Improved fix_invoice_item task +- Fix a bug: events are shown as over and unbookable, starting from midnight at the event end's day - Fix a bug: updating a space/machine/event/training removes the image - Fix a bug: cryptic error message when failed to create a manager - Fix a bug: unable to restore accounting periods closed by a deleted admin diff --git a/app/frontend/src/javascript/controllers/events.js.erb b/app/frontend/src/javascript/controllers/events.js.erb index 6969cb45a..48546ce18 100644 --- a/app/frontend/src/javascript/controllers/events.js.erb +++ b/app/frontend/src/javascript/controllers/events.js.erb @@ -162,6 +162,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' // Get the details for the current event (event's id is recovered from the current URL) $scope.event = eventPromise; + $scope.eventEndDateTime = moment(`${eventPromise.end_date}T${eventPromise.end_time}:00`); // the application global settings $scope.settings = settingsPromise; @@ -259,7 +260,7 @@ Application.Controllers.controller('ShowEventController', ['$scope', '$state', ' $scope.isShowReserveEventButton = () => { return $scope.event.nb_free_places > 0 && !$scope.reserve.toReserve && - $scope.now.isBefore($scope.event.end_date) && + $scope.now.isBefore($scope.eventEndDateTime) && helpers.isUserValidatedByType($scope.ctrl.member, $scope.settings, 'event'); }; diff --git a/app/frontend/templates/events/show.html b/app/frontend/templates/events/show.html index dbfee4a87..ec362a3d5 100644 --- a/app/frontend/templates/events/show.html +++ b/app/frontend/templates/events/show.html @@ -173,7 +173,7 @@ -
+
{{ 'app.public.events_show.event_is_over' }} {{ 'app.public.events_show.thanks_for_coming' }} {{ 'app.public.events_show.view_event_list' }}