Support » Plugin: Gravity Forms Salesforce Add-on » Date format issue for birthdate

  • Resolved Stefan

    (@stefan83)


    Hi – I’m using the Date field for date of birth. The format I’m using is DD/MM/YYYY. The field format in SF is DD/MM/YYYY. However, the result in Salesforce is MM/DD/YYYY. If the DD is greater than 12, nothing displays in SF because its not validating. Is there a way I can fix this?

    https://wordpress.org/plugins/gravity-forms-salesforce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Stefan, did you ever fix this?
    I have the same problem and any assistance would be helpful.

    I had to modify the saleforce plugin directly to make the date in format dd/mm/yyyy. By default the date is in US format.

    Plugin Contributor Zack Katz

    (@katzwebdesign)

    It’s in the FAQ. You can use:

    add_filter('gf_salesforce_format_date', 'modify_gf_salesforce_format_date');
    
    /**
     * The default is US-style,  though Salesforce recommends Y-m-d\'\T\'H:i:s
     * You can use any date formatting as shown here:
     * @link  http://php.net/manual/en/function.date.php
     */
    function modify_gf_salesforce_format_date($previous = '') {
        $date_format = 'Y-m-d\'\T\'H:i:s';
        return $date_format;
    }
    

    Hello. Unfortunately I can’t get that code to work in the site. When changing the code for British date format it doesn’t send the date to Salesforce. Here is the code I’m using. Can you see anything wrong with it? Thanks for your help…

    add_filter('gf_salesforce_format_date', 'modify_gf_salesforce_format_date');
    
    /**
     * The default is US-style,  though Salesforce recommends Y-m-d\'\T\'H:i:s
     * You can use any date formatting as shown here:
     * @link  http://php.net/manual/en/function.date.php
     */
    function modify_gf_salesforce_format_date($previous = '') {
        $date_format = 'd-m-Y\'\T\'H:i:s';
        return $date_format;
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Date format issue for birthdate’ is closed to new replies.