Hey Herbert,
I’m not familiar with the weeknumber option, can you share how you configured the datepicker to use it so I can do some testing?
@ovann86 sorry for the late response…
I used this:
<script>
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
optionsObj.firstDay = 1;
if ( formId == 1 ) {
optionsObj.onClose= function (dateText, inst) {
jQuery(this).val(jQuery.datepicker.iso8601Week(jQuery(this).datepicker("getDate")));
}
}
return optionsObj;
});
</script>
It is working perfectly. Only problem is that the form won’t validate on submission.
Hey,
I see what you mean.
I also see the standard Gravity Forms date field has the same issue with validating.
I’ll have a think about how to best fix this up and will let you know the outcome.
Hey Herbert –
After giving this some thought I think the best approach is to create another filter that allows you to disable the validation on a per form/field/column basis.
I’ll be releasing an update shortly that’ll include this filter.
Example usage:
add_filter( 'itsg_list_field_datepicker_disable_validation', 'itsg_disable_validation', 10, 4 );
function itsg_disable_validation( $default, $form_id, $field_id, $column_number ) {
if ( 43 == $form_id && 31 == $field_id && 1 == $column_number ) {
return true;
}
}
@ovann86 -> Okay that sounds great. I will wait for your release.
Thank you.
It is working perfectly! Thank you ovann86