1
I fill a Datetime field with input type="date"
and I can record it in the database normally.
When I retrieve the bank record and try to display it with the same type of input, it shows me the field filled with 01/01/0001
. If I look at the source code of the page, I see that the date recovered is there, as recorded in the bank, but in the format dd/MM/yyyy
.
I know that the input type=date
need to receive the date in format yyyy-MM-dd
but I don’t know how to do it. What I’m doing wrong?
What server-side language are you using? PHP, MVC C#?
– Diego Vieira
Transform the date of
dd/MM/yyyy
foryyyy-MM-dd
before setting the value.– Beterraba
@Beet I think that’s what the author wants help with ;)
– Jorge B.
@Jorgeb. He asked what he was doing wrong. Not putting the date in the right format is what he’s doing wrong :D!
– Beterraba
I think this has to do with the configuration of the browser or the micro itself.
– Matheus Bessa
I am using MVC4 with c#. The values of the database fields are transferred to the class properties by Model Binder. I don’t know how to change the behavior of the Model Binder so that it formats the date in the format expected by datepicker (yyyy-MM-dd) and I wouldn’t like to do this in the handheld.
– pcmoraes