Changed the way that we define end dates.

This commit is contained in:
2025-07-03 20:53:33 +10:00
parent 168a8806cf
commit bc02b448a4
5 changed files with 67 additions and 4 deletions

View File

@@ -6,6 +6,13 @@ if ( in_array("cmd", array_keys($_GET)) and $_GET["cmd"] == "get" ) {
$ret = getEvents();
} elseif ( $_POST["cmd"] == "put" ) {
$json = base64_decode($_POST["payload"]);
$events = json_decode($json, true);
for ( $i = 0; $i < count($events); $i++ ) {
foreach ( array( "hours", "agenda", "minutes" ) as $field ) {
unset($events[$i][$field]);
}
}
$json = json_encode($events, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
file_put_contents("dat/events.json", $json);
$ret = getEvents();
}