Home › Forums › Calendar Products › Events Calendar PRO › tribe_create_event() EventStartDate incorrect
- This topic has 6 replies, 3 voices, and was last updated 8 years, 8 months ago by
Cliff.
-
AuthorPosts
-
July 28, 2017 at 12:34 pm #1327654
jdonovan
ParticipantI 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
July 28, 2017 at 1:08 pm #1327668jdonovan
ParticipantWell – 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
July 28, 2017 at 3:41 pm #1327707jdonovan
ParticipantWell – 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] => 1Yet 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.
-johnJuly 31, 2017 at 2:28 pm #1328489Cliff
MemberHi, 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?
July 31, 2017 at 5:17 pm #1328544jdonovan
ParticipantThis reply is private.
August 1, 2017 at 3:07 am #1328663Cliff
MemberSounds good. If you do find a bug, feel free to open a new thread with the steps we could try to replicate it.
Thanks!
-
AuthorPosts
- The topic ‘tribe_create_event() EventStartDate incorrect’ is closed to new replies.
