From 4b44961ed3d298180b768a06ceb9b4b9c6d33ff2 Mon Sep 17 00:00:00 2001 From: TheMrNomis Date: Thu, 12 Nov 2015 10:54:00 +0100 Subject: [PATCH] export can be parameterized relative to a week offset --- export.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/export.php b/export.php index 46a1263..4732f7a 100644 --- a/export.php +++ b/export.php @@ -2,6 +2,11 @@ header('Content-type: text/calendar; charset=utf-8'); header('Content-Disposition: inline; filename=calendar.ics'); +if(isset($_GET['w'])&&is_numeric($_GET['w'])) + $weekOffset = $_GET['w']; +else + $weekOffset = 0; + function icaldate($date) { $dt = strtotime($date); @@ -10,7 +15,7 @@ function icaldate($date) include_once('getEvents.php'); $db = connect(); -$events = getEventsSince($db, time()); +$events = getEventsSince($db, strtotime('last monday +'.$weekOffset.' weeks')); $eol = "\r\n"; echo('BEGIN:VCALENDAR'.$eol);