tribe_create_event() EventStartDate incorrect

Home Forums Calendar Products Events Calendar PRO tribe_create_event() EventStartDate incorrect

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1327654
    jdonovan
    Participant

    I have reviewed the documentation and the posts that I could find … but cannot determine why my Event Date is being recorded as “1969-12-31” … which sounds a LOT like 0000-00-00 to me.

    The $args parameter I’m passing to the function is (print_r output):

    Array
    (
    [post_title] => My Cool Event
    [post_content] =>

    My Cool Event Content

    yada yada yada

    [post_status] => publish
    [comment_status] => closed
    [post_category] => Array
    (
    [0] => 6
    )

    [ping_status] => closed
    [EventStartDate] => 2017-07-31 00:00:00
    [EventEndDate] => 2017-07-31 00:00:00
    [EventStartHour] => 12
    [EventStartMinute] => 00
    [EventStartMeridian] => am
    [EventEndHour] => 12
    [EventEndMinute] => 00
    [EventEndMeridian] => am
    [EventShowMap] => 1
    [EventURL] => http://wgasc.dcpsandbox.com/wgasc-events/?eventID=250
    [Venue] => Array
    (
    [Venue] => Aliso Niguel HS
    [Address] => 28800 Wolverine Way
    [City] => Aliso Viejo
    [State] => CA
    [Zip] => 92656
    [post_status] => publish
    [EventShowMap] => 1
    )

    [tax_input] => Array
    (
    [tribe_events_cat] => Array
    (
    [0] => 6
    )

    )

    )

    I have tried different date formats, different time values – all to no avail.

    I’m pretty sure it is something simple and stupid that I’m overlooking. Please advise.

    Thanks.

    -john

    #1327668
    jdonovan
    Participant

    Well – It appears that if you beat on something long enough, things will work.

    I would have never guessed this was required, but it appears that the data string must be wrapped in quotes within the $args array element. Changing the elements to:

    ‘EventStartDate’=> “‘”.date(“Y-m-d H:i:s”, strtotime($this->showDate.” 00:00:00″)).”‘”,
    ‘EventEndDate’ => “‘”.date(“Y-m-d H:i:s”, strtotime($this->showDate.” 00:00:00″)).”‘”,

    appears to have solved the problem.

    Hopefully this level of will prevent someone from running in circles like I have for the past 3 hours.

    -john

    #1327707
    jdonovan
    Participant

    Well – that didn’t actually work after-all. The new Event Posts are being added with the current date, rather than the date defined … so I’m back to square one.

    The $args array includes:

    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [EventStartDate] => ‘2017-08-12 00:00:00’
    [EventEndDate] => ‘2017-08-12 00:00:00’
    [EventStartHour] => 12
    [EventStartMinute] => 00
    [EventStartMeridian] => am
    [EventEndHour] => 12
    [EventEndMinute] => 00
    [EventEndMeridian] => am
    [EventShowMap] => 1

    Yet the Event Date in the new Event Post is the current date – July 28th.

    This is getting really frustrating now.

    Thanks for any/all help on this.
    -john

    #1328489
    Cliff
    Member

    Hi, John. Sorry for the struggles here. Could you please provide the entire code snippet you’re using to try to create this event and also describe where you’ve implemented this / when this code runs?

    #1328544
    jdonovan
    Participant

    This reply is private.

    #1328663
    Cliff
    Member

    Sounds good. If you do find a bug, feel free to open a new thread with the steps we could try to replicate it.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘tribe_create_event() EventStartDate incorrect’ is closed to new replies.