diff options
| author | louis <louis.braun@gmx.de> | 2014-10-07 17:36:33 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2014-10-07 17:36:33 +0200 |
| commit | ebe8ac563b1a393ce4b2e90d3d4ec64fd14a6f2b (patch) | |
| tree | 0d67682f2e9fbed2eafd2ce9315ec28b3f3c36d3 /views/displaymenuitemcurrentview.c | |
| parent | 82f2bbd5c4cfb6304b6dd52f8852495555f3ce3c (diff) | |
| download | vdr-plugin-skindesigner-ebe8ac563b1a393ce4b2e90d3d4ec64fd14a6f2b.tar.gz vdr-plugin-skindesigner-ebe8ac563b1a393ce4b2e90d3d4ec64fd14a6f2b.tar.bz2 | |
added numeric day, month and year tokens in different view elements
Diffstat (limited to 'views/displaymenuitemcurrentview.c')
| -rw-r--r-- | views/displaymenuitemcurrentview.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/views/displaymenuitemcurrentview.c b/views/displaymenuitemcurrentview.c index 13f27c7..7ef9cc0 100644 --- a/views/displaymenuitemcurrentview.c +++ b/views/displaymenuitemcurrentview.c @@ -138,8 +138,15 @@ void cDisplayMenuItemCurrentSchedulesView::Render(void) { stringTokens.insert(pair<string,string>("description", event->Description() ? event->Description() : "")); stringTokens.insert(pair<string,string>("start", *(event->GetTimeString()))); stringTokens.insert(pair<string,string>("stop", *(event->GetEndTimeString()))); - stringTokens.insert(pair<string,string>("day", *WeekDayName(event->StartTime()))); - stringTokens.insert(pair<string,string>("date", *ShortDateString(event->StartTime()))); + + time_t startTime = event->StartTime(); + stringTokens.insert(pair<string,string>("day", *WeekDayName(startTime))); + stringTokens.insert(pair<string,string>("date", *ShortDateString(startTime))); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1)); + bool isRunning = false; time_t now = time(NULL); if ((now >= event->StartTime()) && (now <= event->EndTime())) @@ -539,6 +546,13 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) { recDate = *DateString(start); recTime = *TimeString(start); } + + time_t startTime = event->StartTime(); + struct tm * sStartTime = localtime(&startTime); + intTokens.insert(pair<string, int>("year", sStartTime->tm_year + 1900)); + intTokens.insert(pair<string, int>("daynumeric", sStartTime->tm_mday)); + intTokens.insert(pair<string, int>("month", sStartTime->tm_mon+1)); + int duration = event->Duration() / 60; int recDuration = recording->LengthInSeconds(); recDuration = (recDuration>0)?(recDuration / 60):0; |
