How do I add repeating dates programmatically? I have some JSON data I'm using to populate Drupal 7 database. This involves creating nodes with repeating dates.

This is a sample of the data.

 [field_event_date] =&gt; Array
    (
        [0] =&gt; stdClass Object
            (
                [value] =&gt; 2012-12-14 10:00:00
                [value2] =&gt; 2012-12-14 12:00:00
                [rrule] =&gt; RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20160422T215959Z;WKST=MO
EXDATE:20121221T000000,20130125T000000,20130222T000000,20130329T000000,20130426T000000,20130531T000000,20130628T000000,20130726T000000,20130830T000000,20130927T000000,20131025T000000,20131129T000000,20131220T000000,20140131T000000,20140228T000000,20140328T000000,20140425T000000
                [timezone] =&gt; Europe/London
                [timezone_db] =&gt; Europe/London
                [date_type] =&gt; datetime
            )

        [1] =&gt; stdClass Object
            (
                [value] =&gt; 2012-12-28 10:00:00
                [value2] =&gt; 2012-12-28 12:00:00
                [rrule] =&gt; RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20160422T215959Z;WKST=MO
EXDATE:20121221T000000,20130125T000000,20130222T000000,20130329T000000,20130426T000000,20130531T000000,20130628T000000,20130726T000000,20130830T000000,20130927T000000,20131025T000000,20131129T000000,20131220T000000,20140131T000000,20140228T000000,20140328T000000,20140425T000000
                [timezone] =&gt; Europe/London
                [timezone_db] =&gt; Europe/London
                [date_type] =&gt; datetime
            )
    )


How could I enter this data into the table which stores the date for this node type?
Add [] to the end of the data field.

eg. 

    foreach($vals-&gt;field_event_date as $fed){
        //notice the []!
        $node-&gt;field_date_of_event['und'][]= array(
            'data1' =&gt; $fed-&gt;data1,
            'data2' =&gt; $fed-&gt;data2            
        )
    }