Closed (fixed)
Project:
Event
Version:
6.x-2.x-dev
Component:
API
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2008 at 05:17 UTC
Updated:
11 Aug 2009 at 14:50 UTC
Hello,
what is the correct way to reference event start and end time, when using drupal_execute() to create a node programmatically?
Here is the code I am using
$form_state['values']['start'] = '2008-04-26T13:00:00';
$form_state['values']['end'] = '2008-04-26T13:00:00';
Node gets created OK, but time is set to some default value. I most likely refer to it incorrectly.
Thank you.
Comments
Comment #1
killes@www.drop.org commentedtry replacing the "T" with a blank " ".
Comment #2
dostoevsky commenteddidn't work.
i'm trying different combinations.
Comment #3
gerhard killesreiter commentedI've rewritten the form layer for the event module.
As a result
$form_state['values']['start_exploded'] = array('year' => '2008', 'month' => '04', 'day' => '26', 'hour' => '13' 'minute' => '00' );
should work.
Comment #4
vegeneric commentedthis took me a while to figure out, because anything less than the perfect code here seems to get you very strange results. here's a working snippet for creating events programmatically, in case others run into difficulties:
i was stuck for a while because i tried to write the events section as one array, like this:
which kept returning me the obnoxiously vague 'illegal choice detected, please contact a site admin' message. anyway, hope this helps someone!
Comment #5
dostoevsky commented