diff --git a/partials/activiteiten.html b/partials/activiteiten.html
index 683b53d..beb9f8d 100644
--- a/partials/activiteiten.html
+++ b/partials/activiteiten.html
@@ -1,15 +1,43 @@
{% extends "base.html" %}
{% block main %}
-
Recente en toekomstige activiteiten
- {%if meta.commissie != "" %}
- van de {{ meta.commissienaam }}
- {%endif%}
+
+ {% if meta.datum != "" %}
+ Alle activiteiten op {{ meta.datum }}
+ {% else %}
+ Recente en toekomstige activiteiten
+ {% if meta.commissie != "" %}
+ van de {{ default(meta.commissienaam, "commissie") }}
+ {% endif %}
+ {% endif %}
-
- Activiteiten vanaf vier dagen geleden. Of spring ⏩ naar vandaag.
-
+
+ {% if meta.datum == "" %}
{%if meta.commissie != "" %}
Alles
{%else%}
@@ -21,6 +49,7 @@ Recente en toekomstige activiteiten
{{ d.afko }}
{% if d.afko != meta.commissie %}{%else%}{%endif%}
{% endfor %}
+{% endif %}
diff --git a/tkserv.cc b/tkserv.cc
index 7385247..ed2815b 100644
--- a/tkserv.cc
+++ b/tkserv.cc
@@ -1569,12 +1569,22 @@ int main(int argc, char** argv)
});
sws.d_svr.Get("/activiteiten.html", [&tp](const httplib::Request &req, httplib::Response &res) {
- // from 4 days ago into the future
- string dlim = getDateDBFormat(time(0)-4*86400);
+ string earliest, latest;
+ string dlim = req.get_param_value("datum");
+
+ if (dlim.empty()) {
+ // from 4 days ago into the future
+ earliest = getDateDBFormat(time(0)-4*86400);
+ latest = getDateDBFormat(time(0)+20*365*86400);
+ } else {
+ // only one day. don't offer wider ranges for now
+ earliest = getDateDBFormat(getDateTimestamp(dlim));
+ latest = getDateDBFormat(getDateTimestamp(dlim));
+ }
string today = getTodayDBFormat();
- auto acts = packResultsJson(tp.getLease()->queryT("select Activiteit.datum datum, activiteit.bijgewerkt bijgewerkt, activiteit.nummer nummer, naam, noot, onderwerp, besloten, voortouwAfkorting, voortouwNaam from Activiteit left join Reservering on reservering.activiteitId=activiteit.id left join Zaal on zaal.id=reservering.zaalId where datum > ? order by datum asc", {dlim}));
+ auto acts = packResultsJson(tp.getLease()->queryT("select Activiteit.datum datum, activiteit.bijgewerkt bijgewerkt, activiteit.nummer nummer, naam, noot, onderwerp, besloten, voortouwAfkorting, voortouwNaam from Activiteit left join Reservering on reservering.activiteitId=activiteit.id left join Zaal on zaal.id=reservering.zaalId where Activiteit.datum between date(?) and date(?, '+1 day') order by datum asc", {earliest, latest}));
bool noMarkerYet = true;
struct Commie
@@ -1611,6 +1621,8 @@ int main(int argc, char** argv)
nlohmann::json data = nlohmann::json::object();
data["data"] = acts;
data["meta"]["commissie"] = commissie;
+ data["meta"]["datum"] = dlim.empty() ? "" : earliest;
+ data["meta"]["vandaag"] = today;
data["meta"]["commies"] = nlohmann::json::array();
for(const auto& c : commies) {
nlohmann::json commie = nlohmann::json::object();