I'm getting a problem with the entry_date field when creating an entry via a channel form.
I have set the following parameters on the channel form:
include_jquery="no"
include_assets="no"
datepicker="no"
and I am initializing the date picker field myself as I want to set the date format and date range myself:
//init our datepicker setting date range
$date.datepicker({ minDate: -90, maxDate: "+0D"});
//set our date format based on locale
var locale = navigator.language || navigator.userLanguage;
if (locale === "en-US") {
var dateformat = 'mm/dd/yyyy';
}
else {
var dateformat = 'dd/mm/yyyy';
}
$date.datepicker({dateFormat: dateformat});
After submitting the form When I look in the database (exp_channel_titles) it has the correct values for the year, month and day columns but the entry_date column is saving a timestamp that is always a day behind.
If I change the channel form to use the native EE implementation of the date picker, i.e set my parameters to :
include_jquery="no"
thereby having EE initialize the date picker field then the date is saved correctly but this way I am unable to set the date format or date range.
Any suggestions?