Extension, Fieldtype

Developer
Supported

EEvent Helper

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Derek Hogue

     

You must be logged in to post.

Incorrect date formatting (must be in the form of YYYY-MM-DD) on channel form

Support Request

sheferd
sheferd

EE2.8.1 using channel form

can’t seem to fix tis error:
Incorrect date formatting (must be in the form of YYYY-MM-DD)

<div class="form-field">
    <
label for="">Event (fromdate<em>*</em></label>
    
{!--<input type="text" id="date1" value="" name="en_event_date_1" required />--}
    {field
:en_event_date_1}
   
</div><!-- /.form-field -->
  
   <
div class="form-field">
    <
label for="">Event end date (required for multi day events) <i>optional</i></label>
    
{!--<input type="text" id="date2" value="" name="en_event_date_2" />--}
    {field
:en_event_date_2}
   
</div><!-- /.form-field --> 
sheferd
# 1
sheferd

I should also note the “Clear” link doesn’t work - sends me to the top of the page.

I’m also using jQuery datepicker:

$("[name=en_event_date_1]").datepicker({
   changeMonth
true,//this option for allowing user to select month
   
changeYeartrue//this option for allowing user to select from year range
   
dateFormat"DD, dd M yy",
   
onSelect: function (date{
    
var date2 = $('[name=en_event_date_1]').datepicker('getDate');
    
date2.setDate(date2.getDate() + 1);
    
//sets minDate to dt1 date + 1
    
$('[name=en_event_date_2]').datepicker('option''minDate'date2);
   
}
  }
);
  
  $(
"[name=en_event_date_2]").datepicker({
   changeMonth
true,//this option for allowing user to select month
   
changeYeartrue//this option for allowing user to select from year range
   
dateFormat"DD, dd M yy"
  
}); 
Derek Hogue
# 2
Developer
Derek Hogue

Start by removing your custom datepicker and seeing if the issue remains. Unless you’re disabling third-party assets in your Channel Form tag,  the EEvent Helper fields already have datepicker behaviours applied to them, so I’d guess you’re triggering a javascript error.

EEvent Helper also expects the submitted date to match the global (or current user’s) date format (as EE’s native date fields do), so submitting dates in a different format from that may cause an issue.