Skip to content

Commit

Permalink
Convert to local time before calling dayOfWeek() for week day check.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-kristjansson committed Aug 20, 2011
1 parent 7768968 commit 00f505d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions mythtv/programs/mythbackend/scheduler.cpp
Expand Up @@ -3076,10 +3076,7 @@ void Scheduler::UpdateManuals(int recordid)
case kTimeslotRecord:
progcount = 13;
skipdays = 1;
if (startdt.date().dayOfWeek() < 6)
weekday = true;
else
weekday = false;
weekday = (startdt.toLocalTime().date().dayOfWeek() < 6);
startdt = QDateTime(
MythDate::current().date(), startdt.time(), Qt::UTC);
break;
Expand All @@ -3101,7 +3098,7 @@ void Scheduler::UpdateManuals(int recordid)
{
for (int i = 0; i < (int)chanidlist.size(); i++)
{
if (weekday && startdt.date().dayOfWeek() >= 6)
if (weekday && startdt.toLocalTime().date().dayOfWeek() >= 6)
continue;

query.prepare("REPLACE INTO program (chanid,starttime,endtime,"
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/manualschedule.cpp
Expand Up @@ -90,7 +90,7 @@ bool ManualSchedule::Create(void)
QString dinfo = MythDate::toString(
m_nowDateTime.addDays(index),
MythDate::kDateFull | MythDate::kSimplify);
if (m_nowDateTime.addDays(index).date().dayOfWeek() < 6)
if (m_nowDateTime.addDays(index).toLocalTime().date().dayOfWeek() < 6)
dinfo += QString(" (%1)").arg(tr("5 weekdays if daily"));
else
dinfo += QString(" (%1)").arg(tr("7 days per week if daily"));
Expand Down

0 comments on commit 00f505d

Please sign in to comment.