added token {startsin} in displaymenuschedules

This commit is contained in:
louis 2015-05-14 15:28:50 +02:00
parent e03a6c2b21
commit af59c465aa
4 changed files with 7 additions and 0 deletions

View File

@ -328,3 +328,6 @@ Version 0.4.5
Version 0.4.6
- added token {startsin} in displaymenuschedules

View File

@ -44,6 +44,7 @@
{year} year as number
{running} true if event is currently running
{elapsed} elapsed time of event, if not running 0
{startsin} minutes till event starts, if running 0
{duration} duration of event
{durationhours} duration, full hours
{durationminutes} duration, rest of minutes

View File

@ -30,6 +30,7 @@
{year} year as number
{running} true if event is currently running
{elapsed} elapsed time of event, if not running 0
{startsin} minutes till event starts, if running 0
{duration} duration of event
{durationhours} duration, full hours
{durationminutes} duration, rest of minutes

View File

@ -376,8 +376,10 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) {
intTokens.insert(pair<string,int>("running", isRunning));
if (isRunning) {
intTokens.insert(pair<string,int>("elapsed", (now - event->StartTime())/60));
intTokens.insert(pair<string,int>("startsin", 0));
} else {
intTokens.insert(pair<string,int>("elapsed", 0));
intTokens.insert(pair<string,int>("startsin", (event->StartTime() - now)/60));
}
intTokens.insert(pair<string,int>("duration", event->Duration() / 60));
intTokens.insert(pair<string,int>("durationhours", event->Duration() / 3600));