shirenekboyd / final-capstone-project

Restaurant Reservation System
0 stars 0 forks source link

US-03 Create reservation within eligible timeframe #7

Open shirenekboyd opened 2 years ago

shirenekboyd commented 2 years ago

As a restaurant manager I only want to allow reservations to be created during business hours, up to 60 minutes before closing so that users do not accidentally create a reservation for a time we cannot accommodate.

Acceptance criteria

  1. The /reservations/new page will display an error message with className="alert alert-danger", if any of the following additional constraints are violated:
    • [x] The reservation time is before 10:30 AM.
    • [x] The reservation time is after 9:30 PM, because the restaurant closes at 10:30 PM and the customer needs to have time to enjoy their meal.
    • [x] The reservation date and time combination is in the past. Only future reservations are allowed. E.g., if it is noon, only allow reservations starting after noon today.
shirenekboyd commented 2 years ago

Hint Parsing a Date that includes the time in JavaScript can be tricky. Again, keep an eye out for which time zone is being used for your Dates.