brad
1
All my date pickers that are in modals throw a 400 error. It says it is not a valid date. However it is a perfectly valid date that displays.
I also tried displaying the form field value on the page and it seems it is trying to add a time to the date.
<div class="form-group">
<label for="input2">Event Date {{inputEventDate.value}}</label>
<input class="form-control form-control-sm" id="inputEventDate" name="inputEventDate" aria-describedby="input2_help" required="" type="text" is="dmx-date-picker" format="YYYY-MM-DD">
</div>
brad
2
Actually it seems to be trying to add a time to it?
brad
4
If it helps to know, this is on my very first Wappler site a couple years ago. Date Picker wasn’t available back then.
So it’s a two year old site if that matters.
Could you check in the Headers tab what the actual value is that was posted to insertEvent.php.
brad
6
Not sure how to do that but I do know it is adding the time to the value.
So entering ‘2020-10-01’ is setting a value of ‘2020-10-01 00:00:00’
Teodor
7
Brad, that is supposed to happen … the date picker returns the data in this format.
brad
8
Then why am I getting an invalid format error?
Teodor
9
What Patrick asks about is a screenshot of the Headers when the server action runs:
That looks good, but your validation rule probably only expects a date, so without the time.
brad
12
Alright, thanks. I will maybe replace the form fields and redo them from scratch. Only validation I have on it is ‘required’.
Thanks for confirming it is working as it should.
Teodor
13
Please double check your POST variables in the server action. Maybe there’s a date rule imported there.
brad
14
Yes, that was indeed the case. There was some date validation in the server connect post variables. Works great now. Thank you.