I have a front-end form with two date fields. After upgrading to Craft 3 and implementing what I believe to be all the changes concerning front-end forms in Craft 3 I am experiencing some odd behavior.
The odd behavior
When I enter manually or use jQuery UI Datepicker plugin to enter a desired date into any of the date fields associated with this front-end form (this is the only front-end form on the site currently), the date gets saved one day behind. E.g. if I enter 2018-05-01 it gets saved as 2018-04-30. However, if I go to the admin area and add a new block to this matrix field it saves correctly.
What I changed when upgrading from Craft 2 to 3 is the following:
{{ getCsrfInput() }}
<input type="hidden" name="action" value="entries/saveEntry">
to
{{ csrfInput() }}
<input type="hidden" name="action" value="entries/save-entry">
I also checked and confirmed that I am using the most up-to-date version of jQuery UI to rule out the datepicker as the culprit.
Here is a gist of the form: https://gist.github.com/swthate/08152aefe2c481cd792fc156a9ea1bc6
Note: fields/inputs in question are on line 38 and line 49 of the gist (lotMixDate
and lotExpireDate
).
Thanks!