From df4807e73d34acf7807b389c9af1f7e3f1c416e6 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Sun, 4 Apr 2021 11:57:28 +0100 Subject: [PATCH] Display LiveTV Program start Dates in local timezone --- components/liveTv/ProgramDetails.brs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/components/liveTv/ProgramDetails.brs b/components/liveTv/ProgramDetails.brs index b2dd03d7..99d71e3b 100644 --- a/components/liveTv/ProgramDetails.brs +++ b/components/liveTv/ProgramDetails.brs @@ -115,23 +115,28 @@ sub programUpdated() day = getRelativeDayName(startDate) + ' Get Start Date in local timezone for display to user + localStartDate = createObject("roDateTime") + localStartDate.FromISO8601String(prog.StartDate) + localStartDate.ToLocalTime() + if startDate.AsSeconds() < now.AsSeconds() and endDate.AsSeconds() > now.AsSeconds() then if day = "today" then - m.broadcastDetails.text = tr("Started at") + " " + formatTime(startDate) + m.broadcastDetails.text = tr("Started at") + " " + formatTime(localStartDate) else - m.broadcastDetails.text = tr("Started") + " " + tr(day) + ", " + formatTime(startDate) + m.broadcastDetails.text = tr("Started") + " " + tr(day) + ", " + formatTime(localStartDate) end if else if startDate.AsSeconds() > now.AsSeconds() if day = "today" then - m.broadcastDetails.text = tr("Starts at") + " " + formatTime(startDate) + m.broadcastDetails.text = tr("Starts at") + " " + formatTime(localStartDate) else - m.broadcastDetails.text = tr("Starts") + " " + tr(day) + ", " + formatTime(startDate) + m.broadcastDetails.text = tr("Starts") + " " + tr(day) + ", " + formatTime(localStartDate) end if else if day = "today" then - m.broadcastDetails.text = tr("Ended at") + " " + formatTime(endDate) + m.broadcastDetails.text = tr("Ended at") + " " + formatTime(localStartDate) else - m.broadcastDetails.text = tr("Ended") + " " + tr(day) + ", " + formatTime(endDate) + m.broadcastDetails.text = tr("Ended") + " " + tr(day) + ", " + formatTime(localStartDate) end if end if