Skip to content
Browse files

Convert to local time before calling dayOfWeek() for week day check.

  • Loading branch information...
1 parent 7768968 commit 00f505d62a828a47ef8015647bccd0cf2aa5a085 @daniel-kristjansson daniel-kristjansson committed Aug 20, 2011
Showing with 3 additions and 6 deletions.
  1. +2 −5 mythtv/programs/mythbackend/scheduler.cpp
  2. +1 −1 mythtv/programs/mythfrontend/manualschedule.cpp
View
7 mythtv/programs/mythbackend/scheduler.cpp
@@ -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;
@@ -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,"
View
2 mythtv/programs/mythfrontend/manualschedule.cpp
@@ -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"));

0 comments on commit 00f505d

Please sign in to comment.
Something went wrong with that request. Please try again.