Browse Source

export can be parameterized relative to a week offset

master
n0m1s 10 years ago
parent
commit
4b44961ed3
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      export.php

+ 6
- 1
export.php View File

@ -2,6 +2,11 @@
header('Content-type: text/calendar; charset=utf-8'); header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=calendar.ics'); header('Content-Disposition: inline; filename=calendar.ics');
if(isset($_GET['w'])&&is_numeric($_GET['w']))
$weekOffset = $_GET['w'];
else
$weekOffset = 0;
function icaldate($date) function icaldate($date)
{ {
$dt = strtotime($date); $dt = strtotime($date);
@ -10,7 +15,7 @@ function icaldate($date)
include_once('getEvents.php'); include_once('getEvents.php');
$db = connect(); $db = connect();
$events = getEventsSince($db, time());
$events = getEventsSince($db, strtotime('last monday +'.$weekOffset.' weeks'));
$eol = "\r\n"; $eol = "\r\n";
echo('BEGIN:VCALENDAR'.$eol); echo('BEGIN:VCALENDAR'.$eol);


Loading…
Cancel
Save