summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-13 10:16:04 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-09-13 10:16:04 (GMT)
commit83a192a736bbb46c4806623ecb6c7b5b39a764c1 (patch)
treeb403c0a31eb06ae36d1f576d49c0d2a6bf4869a6
parent40f1ec370d73c6d3e5dbeaa4420cb261d5553fed (diff)
Add the day offset if we are past dawn instead of hardcoded 12
-rw-r--r--kstars/ekos/scheduler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/kstars/ekos/scheduler.cpp b/kstars/ekos/scheduler.cpp
index fa1551f..9e9de84 100644
--- a/kstars/ekos/scheduler.cpp
+++ b/kstars/ekos/scheduler.cpp
@@ -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));