Browse Source

first draft at exporting ical

master
n0m1s 10 years ago
parent
commit
873123dbd8
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      export.php

+ 5
- 5
export.php View File

@ -1,16 +1,16 @@
<?php <?php
//header('Content-type: text/calendar; charset=utf-8');
//header('Content-Disposition: inline; filename=calendar.ics');
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=calendar.ics');
function icaldate($date) function icaldate($date)
{ {
$dt = time($date);
return gmdate('Ymd',$dt).'T'. gmdate('His',$dt). 'Z';
$dt = strtotime($date);
return date('Ymd',$dt).'T'. date('His',$dt). 'Z';
} }
include_once('getEvents.php'); include_once('getEvents.php');
$db = connect(); $db = connect();
$events = getEventsByDate($db, time());
$events = getEventsSince($db, time());
$eol = "\r\n"; $eol = "\r\n";
echo('BEGIN:VCALENDAR'.$eol); echo('BEGIN:VCALENDAR'.$eol);


Loading…
Cancel
Save