diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DateSelect.vue b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DateSelect.vue index b7b53dc1..d69e61ec 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DateSelect.vue +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DateSelect.vue @@ -209,10 +209,11 @@ }, 'json'); }, calculatePrice (roomCode, nights) { - for (const room of this.availableRooms) { - if (room.code === roomCode) { - return room.price + (nights - room.minNights) * room.additionalNightPrice; - } + const room = this.availableRooms.find(obj => { + return obj.code === roomCode; + }); + if (room) { + return room.price + (nights - room.minNights) * room.additionalNightPrice; } return null; } @@ -234,7 +235,8 @@ } }, onDayCreate: (dObj, dStr, fp, dayElem) => { - const day = dayjs(dayElem.dateObj).format('YYYY-MM-DD'); + const day = dayElem.dateObj.getFullYear() + "-" + ("0" + dayElem.dateObj.getMonth()).slice(-2) + + "-" + ("0"+(dayElem.dateObj.getDate()+1)).slice(-2); if (day in this.availableDates) { dayElem.classList.add('available'); }