From ffe665bc701a0e89706394e7180c92e3ea95dd4f Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sun, 27 May 2007 08:02:35 +0000 Subject: - again more flexible handling a lazy input time - redisplay selected or given time (dropdown / input field) in corresponding field after reload --- pages/whats_on.ecpp | 26 ++++++++++++++++++++++---- tools.cpp | 10 ++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index a28b381..7e27bc8 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -15,6 +15,7 @@ using namespace vdrlive; <%args> type = "now"; string attime; +string fixtime; <%session scope="global"> @@ -30,14 +31,19 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); string head; time_t seektime = 0; +string displaytime; if (type == "now") { head = tr("What's running at")+string(" ")+FormatDateTime(tr("%I:%M %p"), time(0)); } else if (type == "next") { head = tr("What's on next?"); } else if (type == "at") { - attime = ExpandTimeString(attime); - seektime = GetTimeT(attime); + if (attime != "") + displaytime = ExpandTimeString(attime); + else if (fixtime != "") + displaytime = ExpandTimeString(fixtime); + + seektime = GetTimeT(displaytime); if (seektime - time(0) + 3600 < 0) // if wanted time is past more then 1h, then use tomorrow seektime += SECSINDAY; head = tr("What's running at") + string(" ") + FormatDateTime(tr("%I:%M %p"), seektime) +string(" (") +FormatDateTime(tr("%a, %b %d"), seektime) + string(")"); @@ -54,12 +60,24 @@ if (type == "now") {