Commit 83a192a7 authored by Jasem Mutlaq's avatar Jasem Mutlaq
Browse files

Add the day offset if we are past dawn instead of hardcoded 12

parent 40f1ec37
......@@ -4235,7 +4235,8 @@ void Scheduler::updatePreDawn()
{
double earlyDawn = Dawn - Options::preDawnTime()/(60.0 * 24.0);
int dayOffset=0;
if (KStarsData::Instance()->lt().time().hour() > 12)
QTime dawn = QTime(0,0,0).addSecs(Dawn*24*3600);
if (KStarsData::Instance()->lt().time() >= dawn)
dayOffset=1;
preDawnDateTime.setDate(KStarsData::Instance()->lt().date().addDays(dayOffset));
preDawnDateTime.setTime(QTime::fromMSecsSinceStartOfDay(earlyDawn * 24 * 3600 * 1000));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment