If I print form_data["birthday"] from my app.py code, I get the following output.
'birthday': datetime.date(1111, 11, 3)
So birthday is a datetime.date object.
If I print form_data["birthday"] from my test.html code using Jinja syntax:
{{ test_data["birthday"] }}
I see the following inside my app:
"Sun, 11 Nov 0001 00:00:00 GMT"
And in the developer tools:
<input class="form-control" id="birthday" name="birthday" type="date" value=Sun, 11 Nov 0001 00:00:00 GMT>
The specified value "Sun," does not conform to the required format, "yyyy-MM-dd".
I do not understand why form_data["birthday"] is not considered a datetime.date object anymore? Why is the time added? Why is it converted to a string? This is causing the problem that I'm not able to maintain the birthday input from the user across multiple requests (i'm saving form data temporarily inside session).
forms.py:
app.py:
test.html:
Issue description
'birthday': datetime.date(1111, 11, 3)
So birthday is a datetime.date object.
{{ test_data["birthday"] }}
I see the following inside my app:
"Sun, 11 Nov 0001 00:00:00 GMT"
And in the developer tools:
<input class="form-control" id="birthday" name="birthday" type="date" value=Sun, 11 Nov 0001 00:00:00 GMT> The specified value "Sun," does not conform to the required format, "yyyy-MM-dd".
I do not understand why form_data["birthday"] is not considered a datetime.date object anymore? Why is the time added? Why is it converted to a string? This is causing the problem that I'm not able to maintain the birthday input from the user across multiple requests (i'm saving form data temporarily inside
session
).