tribe_create_event() works, except start/end dates are being set to 1970

Home Forums Calendar Products Events Calendar PRO tribe_create_event() works, except start/end dates are being set to 1970

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1430601
    Kate Guy
    Participant

    I’m using a custom form, which calls the tribe_create_event() function. All the variables are getting set properly, except for the start/end dates. They are both showing up as 1970-01-01 12:00am.

    Here is the format of my variables being used:

    Array
    (
    [post_title] => Test Event
    [post_content] => Event Description
    [EventStartDate] => 2018-01-29
    [EventEndDate] => 2018-01-30
    [EventAllDay] =>
    [EventStartHour] => 08
    [EventStartMinute] => 00
    [EventStartMeridian] => pm
    [EventEndHour] => 09
    [EventEndMinute] => 00
    [EventEndMeridian] => pm
    [EventURL] => http://www.google.com
    [post_status] => draft
    )

    #1432631
    Barry
    Member

    Hi Kate,

    Thanks for reaching out.

    I don’t have the same experience, I’m afraid. Can you share your actual code (via Gist or a similar service) and provide any context I might need in terms of when it runs?

    Thanks!

    #1432800
    Kate Guy
    Participant

    This reply is private.

    #1432960
    Barry
    Member

    Hmm, it’s difficult to assess without knowing exactly what’s coming in from the form submission (though I’m guessing the information in your first post is from the debug statements you added).

    How about if you add just this code:

    function test_tribe_create_event_call() {
        if ( ! function_exists( 'tribe_create_event' ) ) {
            return;
        }
    
        tribe_create_event( array(
            'post_content' => 'Event Description',
            'post_title' => 'Test Event - ' .uniqid(),
            'EventStartDate' => '2018-01-29',
            'EventEndDate' => '2018-01-30',
            'EventAllDay' => '',
            'EventStartHour' => '08',
            'EventStartMinute' => '00',
            'EventStartMeridian' => 'pm',
            'EventEndHour' => '09',
            'EventEndMinute' => '00',
            'EventEndMeridian' => 'pm',
            'EventURL' => 'http://www.google.com',
            'post_status' => 'draft'
        ) );
    }
    
    add_action( 'init', 'test_tribe_create_event_call', 100 );

    Does that work for you and successfully cause drafts taking place on January 29 to be inserted?

    #1433497
    Kate Guy
    Participant

    This reply is private.

    #1433643
    Barry
    Member

    This reply is private.

    #1433852
    Kate Guy
    Participant

    Is there an archive of older versions I can download? I would like to down grade to 4.5.12.x and re-test.

    #1434657
    Barry
    Member

    Sure, please visit theeventscalendar.com/my-account/downloads and you can access older versions of our plugins (note: how many you see depends on the periods of time that you have held valid license keys).

    #1454293
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘tribe_create_event() works, except start/end dates are being set to 1970’ is closed to new replies.