Hi guys.
I’ve made a form with a Date input (native calendar) but I can’t put a correct default value to that field (I don’t care about format, I just want a default value because of data editing).
I have timestamp and date, both doesn’t work, even following the basic formatting and the suggested one by the console log.
I really don’t know how to get the work done.
If you have any idea of what to test it will be better than nothing!
Dude what can I say… IT WORKS! FINALLY!
The problem is definitely the ng-model. Without it is more tricky but it works like expected.
There are a couple of other issues, so I’ve preferred to clear the field on $ionicView.enter:
document.getElementById("newdate").value="";
THEN if the page is for data editing I set the default date value like that:
and the job is done.
Why I’m doing this? Because the first time you edit the date value the value in the date input field remain the same (the first you’ve choose).
With this trick you can let the form value="" (or even don’t set it) and use these two rows in your controller to make the trick.