Open shirenekboyd opened 2 years ago
Hint There may be more than one validation error on the page at time.
For example, a reservation in the past on a Tuesday violates both rules, so the page should display two errors within a single className="alert alert-danger"
However, the API validation does not need to include multiple validation error messages. You can run the validation in any order and report only one validation error at a time, and the tests will pass.
Also, parsing a date in YYYY-MM-DD format using the built-in Date class assumes the date is a UTC date. UTC is a time standard that is the basis for civil time and time zones worldwide, but it is NOT a timezone. As a result, keep an eye out for how your dates are interpreted by the Date class.
While there is nothing preventing you from using a third party library to handle dates for your project, you are encouraged to use the built-in Date class.
As a restaurant manager I only want to allow reservations to be created on a day when we are open so that users do not accidentally create a reservation for days when we are closed.
Acceptance criteria
/reservations/new
page will display an error message withclassName="alert alert-danger"
if any of the following constraints are violated: