I have a rather large iPad application built using PhoneGap and I was doing some testing to make sure everything was going to work appropriately in
I ended up using the datetime-local but you have to make sure you take into account the timezone when binding to and from the control. We want to store GMT time in the database. I used the below functions to convert back and forth during binding.
function formatHTML5DateTime(date)
{
try
{
if (typeof(date) == 'undefined' || date == null || date == '') return "";
var tmpDate = new Date(date);
// gets the timezone offset in minutes
var offset = tmpDate.getTimezoneOffset();
// apply the timezone offset in reverse to local time
var newDate = tmpDate.addMinutes(Math.abs(offset) * -1);
return newDate.toISOString().replace("Z", "");
}
catch(e)
{
return "";
}
}
function formatJSDate(date)
{
try
{
if (typeof(date) == 'undefined' || date == null || date == '') return "";
var tmpDate = new Date(date);
// gets the timezone offset in minutes
var offset = tmpDate.getTimezoneOffset();
// apply the timezone offset to UTC time
var newDate = tmpDate.addMinutes(offset);
return newDate.toISOString();
}
catch(e)
{
return "";
}
}