diff --git a/frontend/src/components/BookingList.tsx b/frontend/src/components/BookingList.tsx index 33729cde5..ed81a3640 100644 --- a/frontend/src/components/BookingList.tsx +++ b/frontend/src/components/BookingList.tsx @@ -297,6 +297,12 @@ const BookingList = ( setOpenCancelDialog(true) } + const today = new Date() + today.setHours(0) + today.setMinutes(0) + today.setSeconds(0) + today.setMilliseconds(0) + return ( <> @@ -307,7 +313,7 @@ const BookingList = ( {params.row.cancellation && !params.row.cancelRequest && params.row.status !== bookcarsTypes.BookingStatus.Cancelled && - new Date(params.row.from) > new Date() && ( + new Date(params.row.from) >= today && ( diff --git a/mobile/components/Booking.tsx b/mobile/components/Booking.tsx index 688b2d6fe..1af2e8ffe 100644 --- a/mobile/components/Booking.tsx +++ b/mobile/components/Booking.tsx @@ -2,7 +2,7 @@ import React, { memo } from 'react' import { StyleSheet, Text, View, Image } from 'react-native' import { MaterialIcons } from '@expo/vector-icons' import { format } from 'date-fns' -import * as bookcarsTypes from '../miscellaneous/bookcarsTypes' +import * as bookcarsTypes from '../miscellaneous/bookcarsTypes' import * as bookcarsHelper from '../miscellaneous/bookcarsHelper' import BookingStatus from './BookingStatus' @@ -36,6 +36,12 @@ const Booking = ( const car = booking.car as bookcarsTypes.Car const supplier = booking.company as bookcarsTypes.User + const today = new Date() + today.setHours(0) + today.setMinutes(0) + today.setSeconds(0) + today.setMilliseconds(0) + return ( @@ -132,7 +138,7 @@ const Booking = ( {booking.cancellation && !booking.cancelRequest && booking.status !== bookcarsTypes.BookingStatus.Cancelled - && new Date(booking.from) > new Date() + && new Date(booking.from) >= today && (