While they haven’t gained much traction on the desktop, HTML5’s new input types are great when you’re developing for mobile. Whether you use them in a mobile-friendly website or a hybrid app built with Cordova, most mobile devices will complement those regular HTML inputs with task-appropriate keyboard layouts or even show native interfaces in some cases.
Though these new inputs are pretty handy, they do still have a few rough edges. In fact, I ran into a very frustrating issue while trying set the value of a
datetime-local input just today.
In this post, I’ll show you the correct syntax to set the value of a
datetime-local input, and how to set it to the current date and time, while correctly accounting for the user’s time zone.
Click here to read the rest of this post »