Home › Forums › Calendar Products › Events Calendar PRO › tribe_create_event() works, except start/end dates are being set to 1970
- This topic has 9 replies, 2 voices, and was last updated 8 years, 2 months ago by
Kate Guy.
-
AuthorPosts
-
January 19, 2018 at 8:20 am #1430601
Kate Guy
ParticipantI’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
)January 22, 2018 at 11:00 am #1432631Barry
MemberHi 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!
January 22, 2018 at 1:05 pm #1432800Kate Guy
ParticipantThis reply is private.
January 22, 2018 at 2:57 pm #1432960Barry
MemberHmm, 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?
January 23, 2018 at 7:42 am #1433497Kate Guy
ParticipantThis reply is private.
January 23, 2018 at 8:41 am #1433643Barry
MemberThis reply is private.
January 23, 2018 at 11:05 am #1433852Kate Guy
ParticipantIs there an archive of older versions I can download? I would like to down grade to 4.5.12.x and re-test.
January 24, 2018 at 8:04 am #1434657Barry
MemberSure, 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).
February 15, 2018 at 8:36 am #1454293Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘tribe_create_event() works, except start/end dates are being set to 1970’ is closed to new replies.
