-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.php
More file actions
47 lines (38 loc) · 1.02 KB
/
main.php
File metadata and controls
47 lines (38 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once 'repeat.php';
// Get rrule string
$rr = convertToRRule("Every Week", true);
$rr = "FREQ=WEEKLY;INTERVAL=1;FASTFORWARD";
echo $rr;
echo "<br/>";
$start = new DateTime( 'January 1, 2013' );
$due = new DateTime('January 2, 2013');
$comp = new DateTime('January 5, 2013');
echo "start: ".$start->format("m/d/Y");
echo "<br />";
echo "due: ".$due->format("m/d/Y");
echo "<br />";
echo "comp: ".$comp->format("m/d/Y");
echo "<br />";
//$due = 0;
$newDates = getNextDates( $start, $due, $comp, $rr );
if( $newDates[0] === -1 )
{
echo "No next occurrence.";
}
else
{
echo "new start: ".$newDates[0]->format("m/d/Y");
echo "<br />";
echo "new due: ".$newDates[1]->format("m/d/Y");
echo "<br />";
if( $newDates[2] == "" )
{
echo "No next occurrence.";
}
else
{
echo $newDates[2];
}
}
?>