douchong4730 2016-10-27 06:34
浏览 71
已采纳

使用PHP ICalendar使用method =“REQUEST”创建全天事件

With reference to an answer given this link Single day all day appointments in .ics files .

BEGIN:VEVENT
UID:1248
DTSTART;VALUE=DATE:20151218
DTEND;VALUE=DATE:20151219
DTSTAMP:20151218T080000Z
CREATED:20151212T200409Z
DESCRIPTION:examplea
LAST-MODIFIED:20151218T080000Z
LOCATION:
SUMMARY:example summary
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
UID:1249
DTSTART;VALUE=DATE:20151217
DTEND;VALUE=DATE:20151218
DTSTAMP:20151217T080000Z
CREATED:20151212T200409Z
DESCRIPTION:example1
LAST-MODIFIED:20151217T080000Z
LOCATION:
SUMMARY:Example
SEQUENCE:0
STATUS:CONFIRMED
TRANSP:OPAQUE
END:VEVENT

The above sample creates an all day event.. But when I set the method as "REQUEST" the all day event box in outlook gets unchecked. How do I rectify the issue?

  • 写回答

2条回答 默认 最新

  • doucheng3811 2016-10-28 07:32
    关注

    I'm posting the solution for this set the time to start date midnight ( 183000 hours in asia pacific) and set the end date to date+1(182959 hours) This way all day event gets created. Posting my ical file, if someone needs it.

    $ical = "BEGIN:VCALENDAR
    ";
    $ical .= "VERSION:2.0
    ";
    $ical .= "PRODID:-//abc//abc//EN
    ";
    $ical .= "METHOD:"."REQUEST"."
    ";
    $ical .= "BEGIN:VEVENT
    ";
    $ical .= "ORGANIZER;CN=Somename\":mailto:testabc.com 
    ";
    $ical .= "UID:1248
    ";
    $ical .= "SEQUENCE:".$sequence."
    ";
    $ical .= "STATUS:".$status."
    ";
    $ical .= "DTSTART:20161009T183000
    ";
    $ical .= "DTEND:  20161010T182959
    ";
    //$ical .= "DTSTAMP:20161218T183000Z
    ";
    $ical .= "CREATED:20151212T183000
    ";
    $ical .= "DESCRIPTION:example
    ";
    $ical .= "LAST-MODIFIED:20151218T080000Z
    ";
    $ical .= "LOCATION:India
    ";
    $ical .= "SUMMARY:example summary
    ";
    $ical .= "SEQUENCE:0
    ";
    $ical .= "STATUS:CONFIRMED
    ";
    //$ical .= "TRANSP:OPAQUE
    ";\
    $ical .="X-MICROSOFT-CDO-BUSYSTATUS:FREE
    ";
    $ical .="X-MICROSOFT-CDO-IMPORTANCE:1
    ";
    $ical .="X-MICROSOFT-DISALLOW-COUNTER:FALSE
    ";
    $ical .="X-MS-OLK-ALLOWEXTERNCHECK:TRUE
    ";
    $ical .="X-MS-OLK-CONFTYPE:0
    ";
    $ical .="X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
    ";
    $ical .="X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
    ";
    $ical .= "END:VEVENT
    ";
    $ical .= "END:VCALENDAR
    ";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥66 换电脑后应用程序报错
  • ¥50 array数据同步问题
  • ¥15 pic16F877a单片机的外部触发中断程序仿真失效
  • ¥15 Matlab插值拟合差分微分规划图论
  • ¥15 keil5 target not created
  • ¥15 C/C++数据与算法请教
  • ¥15 怎么找志同道合的伙伴
  • ¥20 如何让程序ab.eXe自已删除干净硬盘里的本文件自己的ab.eXe文件
  • ¥50 爬虫预算充足,跪巨佬
  • ¥15 滑块验证码拖动问题悬赏