Title: Date Changes When Form Has Errors
Last modified: August 22, 2016

---

# Date Changes When Form Has Errors

 *  Resolved [bridgetAS](https://wordpress.org/support/users/bridgetas/)
 * (@bridgetas)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/date-changes-when-form-has-errors/)
 * One thing our customers have noticed is that if they miss a fill form and hit
   submit, the date changes on their request. For example, if I am making a reservation
   for Friday and forget to add my phone number, when I resubmit my information,
   the date has changed to Thursday.
 * We have made some modifications to the plugin. Is anyone else experiencing this
   issue?
 * Thank you!!
 * [https://az.theshouthouse.com/reservations/](https://az.theshouthouse.com/reservations/)
 * [https://wordpress.org/plugins/restaurant-reservations/](https://wordpress.org/plugins/restaurant-reservations/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [NateWr](https://wordpress.org/support/users/natewr/)
 * (@natewr)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/date-changes-when-form-has-errors/#post-5880497)
 * Hi bridgetAS,
 * Wow, looks like you’ve done a lot of customizations. I just tested the form myself
   but I wasn’t able to reproduce the problem. Can you give me a specific date/time
   match where the error happens for you? I’ll see if I can reproduce it then.
 * I quickly scanned the changes you made to the `booking-form.js` file, but didn’t
   see anything that stuck out to me. I’d suggest backing up the plugin with all
   of your customizations, then installing the stock one, to see if that helps. 
   That will at least tell you whether the issue is caused by one of your changes,
   so you can start hunting it down.
 *  Thread Starter [bridgetAS](https://wordpress.org/support/users/bridgetas/)
 * (@bridgetas)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/date-changes-when-form-has-errors/#post-5880625)
 * Hi Nate,
 * I am able to more easily recreate the issue here: [https://sd.theshouthouse.com/reservations/](https://sd.theshouthouse.com/reservations/)
 * If you got to March 18th, fill in all information except for your email address
   and submit the reservation. When the form comes back with the error message, 
   the reservation date is set for March 17th. It’s a small error, but it is causing
   some customers to make reservations on the wrong day if they miss a field.
 * Thank you!
 *  [NateWr](https://wordpress.org/support/users/natewr/)
 * (@natewr)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/date-changes-when-form-has-errors/#post-5880628)
 * Hi Bridget,
 * Even at that link I can’t reproduce the problem. When the page reloads it’s still
   at March 18th for me.
 * Since you obviously have the technical skills to make customizations, I’ll give
   you some pointers on how you can figure out where the date is getting changed.
   The date is received and processed in `/includes/Bookings.class.php` in the [validate_submission()](https://github.com/NateWr/restaurant-reservations/blob/master/includes/Booking.class.php#L174-L357).
   I’d recommend you test the date that you receive `$_POST['rtb-date']` and the
   date that is then added to the booking `$this->date` by adding a bit of code 
   at the end of that function to echo it to the browser.
 * That should tell you whether the date is getting shifted during the validation
   process, and how it’s being adjusted.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Date Changes When Form Has Errors’ is closed to new replies.

 * ![](https://ps.w.org/restaurant-reservations/assets/icon-128x128.png?rev=2205491)
 * [Five Star Restaurant Reservations - WordPress Booking Plugin](https://wordpress.org/plugins/restaurant-reservations/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restaurant-reservations/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restaurant-reservations/)
 * [Active Topics](https://wordpress.org/support/plugin/restaurant-reservations/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restaurant-reservations/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restaurant-reservations/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [NateWr](https://wordpress.org/support/users/natewr/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/date-changes-when-form-has-errors/#post-5880628)
 * Status: resolved