使用Date Repeat API将同一天的事件组合到Calendar中

时间:2011-05-02 00:16:43

标签: drupal drupal-views

我使用Date Repeat API来设置每周发生的事件。但是,日期重复只允许您将事件设置为一次(小时和分钟)。为了解决这个限制,我刚刚在内容类型中创建了另一个重复输入。 它工作得很好,但我希望在我的日历中显示两个时隙的节点标题显示为一个。所以,如果我在一天中有三个时间段,它将只显示为一个。

我尝试通过制作一个自定义模块拦截View结果,但它只返回节点的信息而没有关于它将在的实际日期的任何信息。

 [0] => stdClass Object
        (
            [nid] => 145
            [node_title] => Repeat 1
            [node_data_field_recurring_field_recurring_value] => 2011-05-19T20:00:00
            [node_data_field_recurring_field_recurring_rrule] => RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH,FR;UNTIL=20110722T235959Z;WKST=SU
            [node_data_field_recurring_delta] => 0
            [node_type] => test_event
            [node_vid] => 145
            [node_data_field_specific_date_field_specific_date_value] => 2011-06-15T16:00:00
            [node_data_field_specific_date_delta] => 0
            [node_data_field_recurring_2_field_recurring_2_value] => 2011-05-19T00:00:00
            [node_data_field_recurring_2_field_recurring_2_rrule] => RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,FR;UNTIL=20110722T235959Z;WKST=SU
            [node_data_field_recurring_2_delta] => 0
        )

    [1] => stdClass Object
        (
            [nid] => 145
            [node_title] => Repeat 1
            [node_data_field_recurring_field_recurring_value] => 2011-05-19T20:00:00
            [node_data_field_recurring_field_recurring_rrule] => RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH,FR;UNTIL=20110722T235959Z;WKST=SU
            [node_data_field_recurring_delta] => 0
            [node_type] => test_event
            [node_vid] => 145
            [node_data_field_specific_date_field_specific_date_value] => 2011-06-15T16:00:00
            [node_data_field_specific_date_delta] => 0
            [node_data_field_recurring_2_field_recurring_2_value] => 2011-05-20T00:00:00
            [node_data_field_recurring_2_field_recurring_2_rrule] => RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,FR;UNTIL=20110722T235959Z;WKST=SU
            [node_data_field_recurring_2_delta] => 1
        )

    [2] => stdClass Object
        (
            [nid] => 145
            [node_title] => Repeat 1
            [node_data_field_recurring_field_recurring_value] => 2011-05-19T20:00:00
            [node_data_field_recurring_field_recurring_rrule] => RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH,FR;UNTIL=20110722T235959Z;WKST=SU
            [node_data_field_recurring_delta] => 0
            [node_type] => test_event
            [node_vid] => 145
            [node_data_field_specific_date_field_specific_date_value] => 2011-06-15T16:00:00
            [node_data_field_specific_date_delta] => 0
            [node_data_field_recurring_2_field_recurring_2_value] => 2011-05-23T00:00:00
            [node_data_field_recurring_2_field_recurring_2_rrule] => RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,FR;UNTIL=20110722T235959Z;WKST=SU
            [node_data_field_recurring_2_delta] => 2
        )

如您所见,它只返回Repeat规则,所以我认为Calendar模块必须在之后进行计算。但在哪里?

1 个答案:

答案 0 :(得分:0)

我完全采取不同的方法。创建节点引用,以在事件之间创建父对子关系。然后在您的视图中只排除具有父节点的事件。

您必须修改活动模板才能显示子活动。

从数据输入的角度来看,每个事件需要更多的工作,除非进行一些其他自定义以使其有效输入。没有使用它,但它似乎可以加速多节点创建,http://drupal.org/project/editview