【问题标题】:Content query webpart - calendar issue with reccuring events内容查询 Web 部件 - 重复事件的日历问题
【发布时间】:2011-07-05 16:57:46
【问题描述】:

我有一个内容查询 Web 部件,它读​​取日历列表并显示当前正在运行的事件

我遇到的问题是,当我设置重复事件时,我的查询“中断”。

我的 CAML 请求:

<Where>
    <And>
        <Leq>
            <FieldRef Name="EventDate" Nullable="False" Type="DateTime"/>
            <Value Type="DateTime" IncludeTimeValue="TRUE">
            <Today />
            </Value>
        </Leq>
        <Geq>
            <FieldRef Name="EndDate" Nullable="False" Type="DateTime"/>
            <Value Type="DateTime" IncludeTimeValue="TRUE">
            <Today />
            </Value>
        </Geq>
    </And>
</Where>

问题是,重复事件的 EventDate 定义为 无论何时开始,但 EndDate 类似于 10 年后(或在 4499 O_o 年)。

这是重复事件的身份输出(似乎没有什么可以像这样定义它......至少,从我可以玩弄的信息来看)。

Property:ListId | Value:<gibberish>
Property:WebId | Value:<gibberish>
Property:ID | Value:17
Property:Title | Value:maint
Property:FileRef | Value:SiteDirectory/mysite/Lists/Calendrier/17_.000
Property:_x007B_1d22ea11_x002D_1e32_x002D_424e_x002D_89ab_x002D_9fedbadb6ce1_x007D_ | Value:17
Property:Modified | Value:2011-07-05 10:37:02
Property:Author | Value:Admin
Property:Editor | Value:Admin
Property:Created | Value:2011-07-05 10:37:02
Property:PublishingRollupImage | Value:
Property:_Level | Value:1
Property:Comments | Value:
Property:EventDate | Value:2011-07-05 03:00:00
Property:EndDate | Value:2021-01-26 05:00:00
Property:fAllDayEvent | Value:0
Property:LinkUrl | Value:http://localhost/SiteDirectory/mySite/Lists/Calendrier/17_.000
Property:PubDate | Value:Tue, 05 Jul 2011 14:37:02 GMT
Property:ImageUrl | Value:
Property:ImageUrlAltText | Value:
Property:Description | Value:
Property:Style | Value:identity
Property:GroupStyle | Value:Band
Property:__begincolumn | Value:True
Property:__begingroup | Value:False

(此事件定义为每周一和周二发生)。

  1. 我如何知道某个事件是否反复发生?
  2. 如何过滤我的查询以仅包含当前正在发生的周期性事件?

【问题讨论】:

    标签: sharepoint events calendar caml cqwp


    【解决方案1】:

    首先要意识到的是,重复发生的事件系列仅存储为一个事件,而不是每个单独的实例。

    因此开始/结束日期如此之长 - 它是重复的总长度,而不是任何特定实例。

    如果您正在处理重复事件,则有一个 fRecurrance 字段为 True。

    这是您了解重复事件的唯一指南 - 但请注意,处理重复事件是一项艰巨的工作,因此会产生愤怒、仇恨和痛苦......

    MSDN - Understanding the SharePoint calendar and how to export it to iCal format

    【讨论】:

    • 我已经阅读了那篇文章(在提问时间和回答时间之间)。帮助很大。 fRecurrence 对于我的第一个问题,RecurrenceData 对于我的第二个问题,但是,是的,你对愤怒、仇恨和痛苦的评论是准确的,我仍然卡住了 :D
    猜你喜欢
    • 1970-01-01
    • 2022-11-24
    • 1970-01-01
    • 1970-01-01
    • 2010-12-28
    • 2011-02-11
    • 2010-11-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多