fix: make sure calculations in booking flow are correct
This commit is contained in:
committed by
Michael Zetterberg
parent
3e0f503314
commit
a222ecfc5c
@@ -75,6 +75,9 @@ export default function PriceDetailsModal() {
|
||||
return null
|
||||
}
|
||||
|
||||
const checkInDate = dt(fromDate).format("YYYY-MM-DD")
|
||||
const checkOutDate = dt(toDate).format("YYYY-MM-DD")
|
||||
|
||||
const bookingTotal = rooms.reduce(
|
||||
(acc, room) => {
|
||||
if (room) {
|
||||
@@ -89,7 +92,7 @@ export default function PriceDetailsModal() {
|
||||
{ price: 0, priceExVat: 0, vatAmount: 0 }
|
||||
)
|
||||
|
||||
const diff = dt(toDate).diff(fromDate, "days")
|
||||
const diff = dt(checkOutDate).diff(checkInDate, "days")
|
||||
const nights = intl.formatMessage(
|
||||
{ id: "{totalNights, plural, one {# night} other {# nights}}" },
|
||||
{ totalNights: diff }
|
||||
|
||||
Reference in New Issue
Block a user