• Resolved majidmad

    (@majidmad)


    Hi,

    Thank you for your awesome plugin.
    I have some difficulties with the update. I’ve added a custom tag by following code:

    add_filter( "gscf7_special_mail_tags", "add_custom_mail_tag", 10, 2 );
    
    function add_custom_mail_tag( $custom_mail_tags, $form_id ) {
    
       $custom_mail_tags[] = "_datetime";
    
       return $custom_mail_tags;
    }
    add_filter( "wpcf7_special_mail_tags", function( $output, $name, $html ) {
       if ( $name === "_datetime" ) {
          $submission = WPCF7_Submission::get_instance();
          if ( $timestamp = $submission->get_meta( 'timestamp' ) ) {
             $date = date_i18n( get_option( 'date_format' ), $timestamp );
             $time = date_i18n( get_option( 'time_format' ), $timestamp );
             $date_time = $date . " " . $time;
             return $date_time;
          }
       }
       return $output;
    }, 10, 3 );

    It was working great. However, I have no idea why since March 28, 2020, I get all fields specially date time tags as text not in date format. Please look at provided link, there is a place to add name and the other one is number. However, Google Connector sends all date including datetime in text format. I looked at my google sheet and I found that the date has an extra ‘ added to the first of date and it’s only visible if I try to edit the date. When I edit it, and delete that single quotations sign, it will converted to datetimae again.: ‘April 12, 2020 1:11 pm to April 12, 2020 1:11 pm
    I also have no idea why numbers are in text format rather than being number in my google sheet !
    I look forward to hearing from you.
    I’m very grateful in advance.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter majidmad

    (@majidmad)

    Ok, I just checked again and not only time stamp, the numbers also have extra ‘
    They are sent like this: ‘5345345435

    I also tried to add date and time tag provided by plugin itself (not the custom tag), they also have extra ‘ :
    ‘April 12, 2020
    ‘1:17 pm
    ‘5345345435

    How can I solve the issue? Thanks

    Plugin Author westerndeal

    (@westerndeal)

    Hi @majidmad,

    It seems you are using the Pro version of the plugin. We have already fixed this out and soon we would be releasing the updates.

    Thanks
    Abdullah

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wrong date and time format are sent to google sheet’ is closed to new replies.