Commit 36d59a90 authored by Michael Ochmann's avatar Michael Ochmann
Browse files

fixed issue with calendar

parent 756a528b
......@@ -57,7 +57,6 @@ class Calendar {
$lRow .= "\t\t<td>&nbsp;</td>\n";
$this->html .= $this->row($lWeekdays);
while ($dayCount < $numberOfDays) {
if ($dayCount % 7 == 0) {
$this->html .= $this->row($lRow);
......@@ -66,14 +65,14 @@ class Calendar {
$time = mktime(0, 0, 0, $this->month, $day, $this->year);
$today = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$timeString = date("dmY", $time);
$inSource = array_key_exists($timeString, get_object_vars($this->dataSource));
$inSource = in_array($timeString, array_keys(get_object_vars($this->dataSource)));
if ($inSource) {
$lastStart = $this->dataSource->$timeString->begin;
$lastEnd = $this->dataSource->$timeString->end;
}
$highlight = $inSource || $time >= $lastStart && $time <= $lastEnd ? " hasEvent" : "";
$mark = $time == $today ? "today" : "";
$title = isset($this->dataSource->$timeString->title) ? $this->dataSource->$timeString->title : "";
$title = isset($this->dataSource->{$timeString}->title) ? $this->dataSource->{$timeString}->title : "";
$lRow .= "\t\t<td><a href='#' class='$mark$highlight' title='".$title."'>$day</a></td>\n";
$dayCount++;
$day++;
......
......@@ -26,7 +26,7 @@ class CloudCalendar {
}
private function save() {
file_put_contents("cloudcalendar.json", json_encode($this->jsonEvents));
file_put_contents("cloudcalendar.json", json_encode($this->jsonEvents, JSON_PRETTY_PRINT));
}
private function buildEvents() {
......@@ -41,4 +41,4 @@ class CloudCalendar {
$this->jsonEvents[date("dmY", $object->begin)] = $object;
}
}
}
\ No newline at end of file
}
{"14122015":{"title":"Event: Gl\u00fchen","description":"","begin":1450103400,"end":1450133940,"location":"Fachschaftsraum (L05\/06)"},"03122015":{"title":"Analoger Spieleabend","description":"","begin":1449160200,"end":1449183600,"location":"Fachschaftsraum L05\/L06"},"15122015":{"title":"Analoger Spieleabend","description":"","begin":1450197000,"end":1450220400,"location":"Fachschaftsraum (L05\/06)"},"31122015":{"title":"Analoger Spieleabend","description":"","begin":1451579400,"end":1451602800,"location":"Fachschaftsraum (L05\/06)"},"12012016":{"title":"Analoger Spieleabend","description":"","begin":1452616200,"end":1452639600,"location":"Fachschaftsraum (L05\/06)"},"22012016":{"title":"Abschiedsvorlesung Prof. Dr. Kl\u00f6sener","description":"Erinnerung","begin":1453474800,"end":1453480200,"location":"HS2"},"20012016":{"title":"Ratssitzung","description":"Erinnerung","begin":1453314600,"end":1453321800,"location":"L 05\/06"},"29012016":{"title":"Global Game Jam","description":"caldavsyncadapter standard description","begin":1454079600,"end":1454256000,"location":"Geb\u00e4ude R (Langstr. 4\/Irminenfreihof)"},"10012016":{"title":"Woofles","description":"","begin":1452427200,"end":1452452400,"location":""},"28012016":{"title":"Analoger Spieleabend","description":"caldavsyncadapter standard description","begin":1453998600,"end":1454022000,"location":"L05\/06"},"14032016":{"title":"GameDevWeek","description":"caldavsyncadapter standard description","begin":1457942400,"end":1458493200,"location":"X Geb\u00e4ude"},"02022016":{"title":"Ideenfindungstreffen GDW","description":"caldavsyncadapter standard description","begin":1454421600,"end":1454427000,"location":"Mensa"},"26022016":{"title":"2. Ideenfindungstreffen GDW","description":"caldavsyncadapter standard description","begin":1456495200,"end":1456502400,"location":"Mensa schneidershof"},"02032016":{"title":"Ratssitzung FSI","description":"caldavsyncadapter standard description","begin":1456941600,"end":1456947000,"location":"L05\/06"},"01032016":{"title":"Analogspieleabend","description":"caldavsyncadapter standard description","begin":1456849800,"end":1456875000,"location":"L05\/06"},"11042016":{"title":"Ratssitzung","description":"caldavsyncadapter standard description","begin":1460388600,"end":1460394000,"location":"L05\/06"},"07042016":{"title":"Kneipentour","description":"caldavsyncadapter standard description","begin":1460049300,"end":1460066400,"location":"Porta Nigra"},"21042016":{"title":"Analogspieleabend","description":"","begin":1461254400,"end":1461275700,"location":"L05\/06"},"04052016":{"title":"Analogspieleabend","description":"","begin":1462377600,"end":1462398900,"location":"L05\/06"},"19052016":{"title":"Analogspieleabend","description":"","begin":1463673600,"end":1463694900,"location":"L05\/06"},"01062016":{"title":"Analogspieleabend","description":"","begin":1464796800,"end":1464818100,"location":"L05\/06"},"16062016":{"title":"Analogspieleabend","description":"","begin":1466092800,"end":1466114100,"location":"L05\/06"},"29062016":{"title":"Analogspieleabend","description":"","begin":1467216000,"end":1467237300,"location":"L05\/06"},"14072016":{"title":"Analogspieleabend","description":"","begin":1468512000,"end":1468533300,"location":"L05\/06"}}
\ No newline at end of file
{
"14122015": {
"title": "Event: Gl\u00fchen",
"description": "",
"begin": 1450103400,
"end": 1450133940,
"location": "Fachschaftsraum (L05\/06)"
},
"03122015": {
"title": "Analoger Spieleabend",
"description": "",
"begin": 1449160200,
"end": 1449183600,
"location": "Fachschaftsraum L05\/L06"
},
"15122015": {
"title": "Analoger Spieleabend",
"description": "",
"begin": 1450197000,
"end": 1450220400,
"location": "Fachschaftsraum (L05\/06)"
},
"31122015": {
"title": "Analoger Spieleabend",
"description": "",
"begin": 1451579400,
"end": 1451602800,
"location": "Fachschaftsraum (L05\/06)"
},
"12012016": {
"title": "Analoger Spieleabend",
"description": "",
"begin": 1452616200,
"end": 1452639600,
"location": "Fachschaftsraum (L05\/06)"
},
"22012016": {
"title": "Abschiedsvorlesung Prof. Dr. Kl\u00f6sener",
"description": "Erinnerung",
"begin": 1453474800,
"end": 1453480200,
"location": "HS2"
},
"20012016": {
"title": "Ratssitzung",
"description": "Erinnerung",
"begin": 1453314600,
"end": 1453321800,
"location": "L 05\/06"
},
"29012016": {
"title": "Global Game Jam",
"description": "caldavsyncadapter standard description",
"begin": 1454079600,
"end": 1454256000,
"location": "Geb\u00e4ude R (Langstr. 4\/Irminenfreihof)"
},
"10012016": {
"title": "Woofles",
"description": "",
"begin": 1452427200,
"end": 1452452400,
"location": ""
},
"28012016": {
"title": "Analoger Spieleabend",
"description": "caldavsyncadapter standard description",
"begin": 1453998600,
"end": 1454022000,
"location": "L05\/06"
},
"14032016": {
"title": "GameDevWeek",
"description": "caldavsyncadapter standard description",
"begin": 1457942400,
"end": 1458493200,
"location": "X Geb\u00e4ude"
},
"02022016": {
"title": "Ideenfindungstreffen GDW",
"description": "caldavsyncadapter standard description",
"begin": 1454421600,
"end": 1454427000,
"location": "Mensa"
},
"26022016": {
"title": "2. Ideenfindungstreffen GDW",
"description": "caldavsyncadapter standard description",
"begin": 1456495200,
"end": 1456502400,
"location": "Mensa schneidershof"
},
"02032016": {
"title": "Ratssitzung FSI",
"description": "caldavsyncadapter standard description",
"begin": 1456941600,
"end": 1456947000,
"location": "L05\/06"
},
"01032016": {
"title": "Analogspieleabend",
"description": "caldavsyncadapter standard description",
"begin": 1456849800,
"end": 1456875000,
"location": "L05\/06"
},
"11042016": {
"title": "Ratssitzung",
"description": "caldavsyncadapter standard description",
"begin": 1460388600,
"end": 1460394000,
"location": "L05\/06"
},
"07042016": {
"title": "Kneipentour",
"description": "caldavsyncadapter standard description",
"begin": 1460049300,
"end": 1460066400,
"location": "Porta Nigra"
},
"21042016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1461254400,
"end": 1461275700,
"location": "L05\/06"
},
"04052016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1462377600,
"end": 1462398900,
"location": "L05\/06"
},
"19052016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1463673600,
"end": 1463694900,
"location": "L05\/06"
},
"01062016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1464796800,
"end": 1464818100,
"location": "L05\/06"
},
"16062016": {
"title": "Analogspieleabend",
"description": "Erinnerung",
"begin": 1466092800,
"end": 1466114100,
"location": "L05\/06"
},
"29062016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1467216000,
"end": 1467237300,
"location": "L05\/06"
},
"14072016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1468512000,
"end": 1468533300,
"location": "L05\/06"
},
"28052016": {
"title": "FSI-Fest",
"description": "",
"begin": 1464436800,
"end": 1464472500,
"location": "Turnhalle"
},
"18062016": {
"title": "Netzwerkinstallationsveranstaltung",
"description": "",
"begin": 1466258400,
"end": 1466323200,
"location": "Aula"
},
"13052016": {
"title": "Night of the living Devs",
"description": "",
"begin": 1463090400,
"end": 1463176800,
"location": ""
},
"24052016": {
"title": "Ratssitzung",
"description": "",
"begin": 1464091200,
"end": 1464096600,
"location": "L05\/06"
},
"06062016": {
"title": "Ratssitzung",
"description": "",
"begin": 1465220700,
"end": 1465226100,
"location": "L05\/06"
},
"14062016": {
"title": "Vollversammlung",
"description": "",
"begin": 1465901100,
"end": 1465903800,
"location": "HS3"
},
"06072016": {
"title": "Bits dont Bite",
"description": "caldavsyncadapter standard description",
"begin": 1467819000,
"end": 1467822600,
"location": "X16"
},
"28072016": {
"title": "Analogspieleabend",
"description": "",
"begin": 1469721600,
"end": 1469742900,
"location": ""
},
"26092016": {
"title": "GameDevWeek",
"description": "",
"begin": 1474840800,
"end": 1475445600,
"location": "X-Geb\u00e4ude"
},
"23092016": {
"title": "GDW Ideenwahl + Bootcamp",
"description": "",
"begin": 1474621200,
"end": 1474642800,
"location": "X19"
},
"22092016": {
"title": "GDW Ideenfindungstreffen",
"description": "",
"begin": 1474545600,
"end": 1474551000,
"location": "Irminenfreihof"
},
"14092016": {
"title": "Ratssitzung",
"description": "Ratssitzung",
"begin": 1473867000,
"end": 1473870600,
"location": "L05\/06"
},
"10102016": {
"title": "Trainingstermin Train-Now",
"description": "Erinnerung an ein Ereignis",
"begin": 1476111600,
"end": 1476115200,
"location": ""
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment