I have a car rent site where people can book a car for their needs. The problem is my vehicles are limited so after booking a car I want to immediately show an alert for the next 1 hour that it is overbooked so no one can book it again within that hour.
Here is my approach-
- Fetching only today's booking info
- Checking whether every vehicle is booked or not
- If it is booked, then count the booking time and current time and compare them. Is it equal to or less then 1 hour?
- If it returns true then show the alert
Now problem is how can I remove this message after 1 hour?
Any code example would be highly appreciated. Thanks