I have the following form on my page:
<input id='startDate' type='datetime-local' step=1 name='startDate'>
I use this code to get the field value:
var start = $('#startDate').val();
My problem is that the value of the input field remains undefined until each part of it is filled, including hours, minutes, seconds and AM / PM. I would like to be able to get value from a form in just a year.
How can i do this? I'm glad to have zero values that aren't populated, but I can't figure out how to get the portion of the local datetime-local that the user has populated.
I know that I can do this using an addition to the time zone for jQuery UI datepicker, but I really do not want to go this route - I, as a Chrome implementation, are much better.
source
share