Undefined fieldId in gform.addFilter for limiting dates in datepicker – Gravity Forms

After debugging, I noticed that the formId in the hooked function for filter was actually fieldId for the date field and hence the fieldId undefined.

Here no actual formId is received in hooked JS filter function and the actual fieldId is passed as formId. So, quick workaround I applied using formId only, is:

// Allow past and current dates only
$custom_datepicker_init = "
jQuery(document).ready(function($) {
    gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
        // Apply to field 101 of form 1 only
        // As this is nested form, so reports fieldId as formId and
        // leaving fieldId undefined, behave accordingly :)
        if(formId == 101) {
            optionsObj.maxDate = 0;
        }
        return optionsObj;
    } );
});";
wp_add_inline_script( 'gform_datepicker_init', $custom_datepicker_init, 'before' );

I think, this behavior is due to use of Gravity Forms Nested Forms in current Gravity Form.
Hope it helps someone while debugging the problem.