apoo apoo - 28 days ago 8
PHP Question

Create all day event with method = "REQUEST" using PHP ICalender

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?

Answer

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\r\n";
$ical .= "VERSION:2.0\r\n";
$ical .= "PRODID:-//abc//abc//EN\r\n";
$ical .= "METHOD:"."REQUEST"."\r\n";
$ical .= "BEGIN:VEVENT\r\n";
$ical .= "ORGANIZER;CN=Somename\":mailto:testabc.com \r\n";
$ical .= "UID:1248\r\n";
$ical .= "SEQUENCE:".$sequence."\r\n";
$ical .= "STATUS:".$status."\r\n";
$ical .= "DTSTART:20161009T183000\r\n";
$ical .= "DTEND:  20161010T182959\r\n";
//$ical .= "DTSTAMP:20161218T183000Z\r\n";
$ical .= "CREATED:20151212T183000\r\n";
$ical .= "DESCRIPTION:example\r\n";
$ical .= "LAST-MODIFIED:20151218T080000Z\r\n";
$ical .= "LOCATION:India\r\n";
$ical .= "SUMMARY:example summary\r\n";
$ical .= "SEQUENCE:0\r\n";
$ical .= "STATUS:CONFIRMED\r\n";
//$ical .= "TRANSP:OPAQUE\r\n";\
$ical .="X-MICROSOFT-CDO-BUSYSTATUS:FREE\r\n";
$ical .="X-MICROSOFT-CDO-IMPORTANCE:1\r\n";
$ical .="X-MICROSOFT-DISALLOW-COUNTER:FALSE\r\n";
$ical .="X-MS-OLK-ALLOWEXTERNCHECK:TRUE\r\n";
$ical .="X-MS-OLK-CONFTYPE:0\r\n";
$ical .="X-MICROSOFT-CDO-ALLDAYEVENT:TRUE\r\n";
$ical .="X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE\r\n";
$ical .= "END:VEVENT\r\n";
$ical .= "END:VCALENDAR\r\n";
Comments