I have a reservation site that uses an Angular datepicker to select the date, the date is then put into sessionStorage, then parsed (in the cart), and then sent to the database. In the database, the dates look like:
2021-07-03 06:00:00
2021-06-20 05:00:00
Through out the process, everything has the type of Date front end and backend.
The problem is I need to check stock when the next person makes a reservation. So I have the following method:
console.log(this.date); // Sat Jul 03 2021 00:00:00 GMT-0500 (Central Daylight Time)
this.api.getAllOrdersByDate(this.date).subscribe((res)=>{
console.log(res); // []
but since this date hasn't gone through the sessionStorage/database, it is still in Datepicker format and therefore my method comes back with an empty array.
What do I need to do to get the formats to match?
Thanks!!