plasma: use more recent date for calculating the moon phase in luna applet

to align with the references, other than that the precision loss is
unavoidable

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-04 22:05:32 +03:00
parent 51cb069b3c
commit 84c456fb9f

View file

@ -31,7 +31,7 @@ static const qreal s_moonmonth = 29.53059;
static int kLunaPhase()
{
static const QDateTime firsnewmoon = QDateTime(QDate(1900, 1, 1), QTime(0, 0, 0), Qt::UTC);
static const QDateTime firsnewmoon = QDateTime(QDate(1999, 8, 11), QTime(0, 0, 0), Qt::UTC);
const QDateTime now = QDateTime::currentDateTime();
const qreal gregoriandays = qreal(-now.daysTo(firsnewmoon.toLocalTime()));
qreal moonphase = 0;