Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kholidays for openSUSE:Factory 
checked in at 2022-08-15 19:57:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kholidays (Old)
 and      /work/SRC/openSUSE:Factory/.kholidays.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kholidays"

Mon Aug 15 19:57:21 2022 rev:87 rq:994975 version:5.97.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kholidays/kholidays.changes      2022-07-11 
19:10:02.059664208 +0200
+++ /work/SRC/openSUSE:Factory/.kholidays.new.1521/kholidays.changes    
2022-08-15 19:59:20.705248305 +0200
@@ -1,0 +2,16 @@
+Sun Aug  7 22:27:25 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr>
+
+- Update to 5.97.0
+  * New feature release
+  * For more details please see:
+  * https://kde.org/announcements/frameworks/5/5.97.0
+- Changes since 5.96.0:
+  * Use non-deprecated API unconditionally everywhere
+  * Implement deprecated API by calling the new one
+  * Actually test things rather than just produce debug output
+  * Make rawHolidays() with category filter also work with seasonal holidays
+  * Actually implement HolidayRegion::rawHolidays()
+  * Actually include seasonal holidays in rawHolidaysWithAstroSeasons()
+  * Add methods to check for polar days/nights
+
+-------------------------------------------------------------------

Old:
----
  kholidays-5.96.0.tar.xz
  kholidays-5.96.0.tar.xz.sig

New:
----
  kholidays-5.97.0.tar.xz
  kholidays-5.97.0.tar.xz.sig

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kholidays.spec ++++++
--- /var/tmp/diff_new_pack.GyMFVP/_old  2022-08-15 19:59:21.141249521 +0200
+++ /var/tmp/diff_new_pack.GyMFVP/_new  2022-08-15 19:59:21.145249531 +0200
@@ -17,14 +17,14 @@
 
 
 %define lname   libKF5Holidays5
-%define _tar_path 5.96
+%define _tar_path 5.97
 # Full KF5 version (e.g. 5.33.0)
 %{!?_kf5_version: %global _kf5_version %{version}}
 # Last major and minor KF5 version (e.g. 5.33)
 %{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | 
awk -F. '{print $1"."$2}')}
 %bcond_without released
 Name:           kholidays
-Version:        5.96.0
+Version:        5.97.0
 Release:        0
 Summary:        Holiday calculation library
 License:        LGPL-2.1-or-later


++++++ kholidays-5.96.0.tar.xz -> kholidays-5.97.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/CMakeLists.txt 
new/kholidays-5.97.0/CMakeLists.txt
--- old/kholidays-5.96.0/CMakeLists.txt 2022-07-02 17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/CMakeLists.txt 2022-08-07 15:24:30.000000000 +0200
@@ -1,9 +1,9 @@
 cmake_minimum_required(VERSION 3.16)
 
-set(KF_VERSION "5.96.0")
+set(KF_VERSION "5.97.0")
 project(KHolidays VERSION ${KF_VERSION})
 
-find_package(ECM 5.96.0 REQUIRED NO_MODULE)
+find_package(ECM 5.97.0 REQUIRED NO_MODULE)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
 set(CMAKE_AUTORCC ON)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/autotests/testholidayregion.cpp 
new/kholidays-5.97.0/autotests/testholidayregion.cpp
--- old/kholidays-5.96.0/autotests/testholidayregion.cpp        2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/autotests/testholidayregion.cpp        2022-08-07 
15:24:30.000000000 +0200
@@ -47,11 +47,7 @@
 void HolidayRegionTest::parseRegionCalendarYear(const KHolidays::HolidayRegion 
&region, int year, const QString &calendarType)
 {
     qDebug() << "Parsing region = " << region.regionCode() << " year = " << 
year << " calendar = " << calendarType;
-#if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
-    printHolidays(region.holidays(year));
-#else
     printHolidays(region.rawHolidaysWithAstroSeasons(year));
-#endif
     qDebug() << "";
 }
 
@@ -59,11 +55,7 @@
 {
     qDebug() << "Parsing regionCode = " << region.regionCode() << " start date 
= " << startDate.toString(Qt::ISODate)
              << " end date = " << endDate.toString(Qt::ISODate);
-#if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
-    printHolidays(region.holidays(startDate, endDate));
-#else
     printHolidays(region.rawHolidaysWithAstroSeasons(startDate, endDate));
-#endif
     qDebug() << "";
 }
 
@@ -78,11 +70,7 @@
 void HolidayRegionTest::parseRegionDate(const KHolidays::HolidayRegion 
&region, const QDate &date)
 {
     qDebug() << "Parsing regionCode = " << region.regionCode() << " date = " 
<< date.toString(Qt::ISODate);
-#if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
-    printHolidays(region.holidays(date));
-#else
     printHolidays(region.rawHolidaysWithAstroSeasons(date));
-#endif
     qDebug() << "";
 }
 
@@ -203,12 +191,38 @@
 void HolidayRegionTest::testSolistaleInHolidays()
 {
     KHolidays::HolidayRegion region(QFileInfo(KDESRCDIR 
"/holiday_solstice_in_holidays"));
-    printMetadata(region);
-    parseRegionDateRange(region, QDate(2020, 7, 1), QDate(2021, 6, 30));
-    parseRegionDateRange(region, QDate(2020, 1, 1), QDate(2020, 12, 31));
-    parseRegionDateRange(region, QDate(2020, 11, 1), QDate(2021, 1, 2));
-    parseRegionDateRange(region, QDate(2020, 12, 25), QDate(2021, 7, 2));
-    parseRegionDateRange(region, QDate(2020, 12, 25), QDate(2022, 1, 2));
+
+    auto holidays = region.rawHolidaysWithAstroSeasons(QDate(2020, 7, 1), 
QDate(2021, 6, 30));
+    QCOMPARE(holidays.size(), 5);
+    QCOMPARE(holidays.first().observedStartDate(), QDate(2020, 9, 22));
+    QCOMPARE(holidays.first().name(), QLatin1String("September Equinox"));
+
+    holidays = region.rawHolidays(QDate(2020, 7, 1), QDate(2021, 6, 30));
+    QCOMPARE(holidays.size(), 1);
+    QCOMPARE(holidays.first().observedStartDate(), QDate(2021, 1, 1));
+    QCOMPARE(holidays.first().name(), QLatin1String("New Years"));
+
+    holidays = region.rawHolidays(QDate(2020, 7, 1), QDate(2021, 6, 30), 
QLatin1String("public"));
+    QCOMPARE(holidays.size(), 1);
+    QCOMPARE(holidays.first().observedStartDate(), QDate(2021, 1, 1));
+    QCOMPARE(holidays.first().name(), QLatin1String("New Years"));
+
+    holidays = region.rawHolidays(QDate(2020, 7, 1), QDate(2021, 6, 30), 
QLatin1String("seasonal"));
+    QCOMPARE(holidays.size(), 4);
+    QCOMPARE(holidays.first().observedStartDate(), QDate(2020, 9, 22));
+    QCOMPARE(holidays.first().name(), QLatin1String("September Equinox"));
+
+    holidays = region.rawHolidaysWithAstroSeasons(2020);
+    QCOMPARE(holidays.size(), 5);
+    QCOMPARE(holidays.first().observedStartDate(), QDate(2020, 1, 1));
+    QCOMPARE(holidays.first().name(), QLatin1String("New Years"));
+    QCOMPARE(holidays.last().observedStartDate(), QDate(2020, 12, 21));
+    QCOMPARE(holidays.last().name(), QLatin1String("December Solstice"));
+
+    holidays = region.rawHolidaysWithAstroSeasons(QDate(2021, 3, 20));
+    QCOMPARE(holidays.size(), 1);
+    QCOMPARE(holidays.first().observedStartDate(), QDate(2021, 3, 20));
+    QCOMPARE(holidays.first().name(), QLatin1String("March Equinox"));
 }
 
 void HolidayRegionTest::testLoadFileCalendarSystemsForPlasma()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/autotests/testsunriseset.cpp 
new/kholidays-5.97.0/autotests/testsunriseset.cpp
--- old/kholidays-5.96.0/autotests/testsunriseset.cpp   2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/autotests/testsunriseset.cpp   2022-08-07 
15:24:30.000000000 +0200
@@ -124,3 +124,81 @@
     QCOMPARE(utcDusk(QDate(2012, 7, 1), -14.60, 133.77), QTime(9, 10));
     QCOMPARE(utcDusk(QDate(2012, 12, 31), -14.60, 133.77), QTime(10, 1));
 }
+
+static bool verifyPolarDayRange(QDate begin, QDate end, double latitude, bool 
expected)
+{
+    for (QDate date = begin; date <= end; date = date.addDays(1)) {
+        if (isPolarDay(date, latitude) != expected) {
+            qDebug() << date << latitude << isPolarDay(date, latitude) << 
expected;
+            return false;
+        }
+        if (expected && utcSunrise(date, latitude, 0.0).isValid() && 
utcSunset(date, latitude, 0.0).isValid()) {
+            qDebug() << date << latitude << utcSunrise(date, latitude, 0.0) << 
utcSunset(date, latitude, 0.0);
+            return false;
+        }
+    }
+    return true;
+}
+
+static bool verifyPolarTwilightRange(QDate begin, QDate end, double latitude, 
bool expected)
+{
+    for (QDate date = begin; date <= end; date = date.addDays(1)) {
+        if (isPolarTwilight(date, latitude) != expected) {
+            qDebug() << date << latitude << isPolarTwilight(date, latitude) << 
expected;
+            return false;
+        }
+    }
+    return true;
+}
+
+static bool verifyPolarNightRange(QDate begin, QDate end, double latitude, 
bool expected)
+{
+    for (QDate date = begin; date <= end; date = date.addDays(1)) {
+        if (isPolarNight(date, latitude) != expected) {
+            qDebug() << date << latitude << isPolarNight(date, latitude) << 
expected;
+            return false;
+        }
+        if (expected && utcSunrise(date, latitude, 0.0).isValid() && 
utcSunset(date, latitude, 0.0).isValid()) {
+            qDebug() << date << latitude << utcSunrise(date, latitude, 0.0) << 
utcSunset(date, latitude, 0.0);
+            return false;
+        }
+    }
+    return true;
+}
+
+void SunriseTest::TestPolarDayNight()
+{
+    // polar circle (north): polar day from 6th June to 6st July, no polar 
night
+    QVERIFY(verifyPolarDayRange(QDate(2022, 1, 1), QDate(2022, 6, 5), 66.5, 
false));
+    QVERIFY(verifyPolarDayRange(QDate(2022, 6, 6), QDate(2022, 7, 5), 66.5, 
true));
+    QVERIFY(verifyPolarDayRange(QDate(2022, 7, 6), QDate(2022, 12, 31), 66.5, 
false));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 1, 1), QDate(2022, 12, 31), 
66.5, false));
+
+    // polar circle (south): same in reverse
+    QVERIFY(verifyPolarDayRange(QDate(2021, 1, 6), QDate(2021, 12, 7), -66.5, 
false));
+    QVERIFY(verifyPolarDayRange(QDate(2021, 12, 8), QDate(2022, 1, 4), -66.5, 
true));
+    QVERIFY(verifyPolarDayRange(QDate(2022, 1, 5), QDate(2022, 12, 7), -66.5, 
false));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 1, 1), QDate(2022, 12, 31), 
-66.5, false));
+
+    // 68??: polar twilight from Dec 9 to Jan 2, no polar night
+    QVERIFY(verifyPolarTwilightRange(QDate(2021, 1, 3), QDate(2021, 12, 8), 
68.0, false));
+    QVERIFY(verifyPolarTwilightRange(QDate(2021, 12, 9), QDate(2022, 1, 2), 
68.0, true));
+    QVERIFY(verifyPolarTwilightRange(QDate(2022, 1, 3), QDate(2022, 12, 8), 
68.0, false));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 1, 1), QDate(2022, 12, 31), 
68.0, false));
+
+    // -68??: polar twilight from June 8 to July 3, no polar night
+    QVERIFY(verifyPolarTwilightRange(QDate(2021, 1, 1), QDate(2021, 6, 7), 
-68.0, false));
+    QVERIFY(verifyPolarTwilightRange(QDate(2021, 6, 8), QDate(2021, 7, 3), 
-68.0, true));
+    QVERIFY(verifyPolarTwilightRange(QDate(2021, 7, 4), QDate(2021, 12, 31), 
-68.0, false));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 1, 1), QDate(2022, 12, 31), 
-68.0, false));
+
+    // 78.5??: polar night from Nov 11 to Jan 30
+    QVERIFY(verifyPolarNightRange(QDate(2021, 1, 31), QDate(2021, 11, 10), 
78.5, false));
+    QVERIFY(verifyPolarNightRange(QDate(2021, 11, 11), QDate(2022, 1, 30), 
78.5, true));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 1, 31), QDate(2022, 11, 10), 
78.5, false));
+
+    // -78.5??: polar night from May 10 to Aug 2
+    QVERIFY(verifyPolarNightRange(QDate(2022, 1, 1), QDate(2022, 5, 9), -78.5, 
false));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 5, 10), QDate(2022, 8, 2), 
-78.5, true));
+    QVERIFY(verifyPolarNightRange(QDate(2022, 8, 3), QDate(2022, 12, 31), 
-78.5, false));
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/autotests/testsunriseset.h 
new/kholidays-5.97.0/autotests/testsunriseset.h
--- old/kholidays-5.96.0/autotests/testsunriseset.h     2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/autotests/testsunriseset.h     2022-08-07 
15:24:30.000000000 +0200
@@ -19,6 +19,7 @@
     void TestSunset();
     void TestDawn();
     void TestDusk();
+    void TestPolarDayNight();
 };
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/po/ca@valencia/libkholidays5_qt.po 
new/kholidays-5.97.0/po/ca@valencia/libkholidays5_qt.po
--- old/kholidays-5.96.0/po/ca@valencia/libkholidays5_qt.po     2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/po/ca@valencia/libkholidays5_qt.po     2022-08-07 
15:24:30.000000000 +0200
@@ -128,7 +128,7 @@
 #: holidayregion.cpp:920
 msgctxt "HolidayRegion|UK Region"
 msgid "England and Wales"
-msgstr "Anglaterra i Gales"
+msgstr "Anglaterra i Gal??les"
 
 #: holidayregion.cpp:922
 msgctxt "HolidayRegion|UK Region"
@@ -138,7 +138,7 @@
 #: holidayregion.cpp:924
 msgctxt "HolidayRegion|UK Region"
 msgid "Wales"
-msgstr "Gales"
+msgstr "Gal??les"
 
 #: holidayregion.cpp:926
 msgctxt "HolidayRegion|UK Region"
@@ -158,7 +158,7 @@
 #: holidayregion.cpp:932
 msgctxt "HolidayRegion|"
 msgid "New South Wales"
-msgstr "Nova Gales del sud"
+msgstr "Nova Gal??les del sud"
 
 #: holidayregion.cpp:934
 msgctxt "HolidayRegion|Australian Region"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/po/cs/libkholidays5_qt.po 
new/kholidays-5.97.0/po/cs/libkholidays5_qt.po
--- old/kholidays-5.96.0/po/cs/libkholidays5_qt.po      2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/po/cs/libkholidays5_qt.po      2022-08-07 
15:24:30.000000000 +0200
@@ -2,14 +2,14 @@
 # This file is distributed under the same license as the PACKAGE package.
 # Luk???? Tinkl <lti...@redhat.com>, 2010, 2011, 2012.
 # V??t Pel????k <v...@pelcak.org>, 2010, 2011, 2014, 2016, 2017, 2020.
-# Vit Pelcak <vpel...@suse.cz>, 2021.
+# Vit Pelcak <vpel...@suse.cz>, 2021, 2022.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: libkholidays\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n";
 "POT-Creation-Date: 2015-06-13 09:34+0000\n"
-"PO-Revision-Date: 2021-03-26 14:41+0100\n"
+"PO-Revision-Date: 2022-06-27 14:44+0200\n"
 "Last-Translator: Vit Pelcak <vpel...@suse.cz>\n"
 "Language-Team: Czech <kde-i18n-...@kde.org>\n"
 "Language: cs\n"
@@ -17,7 +17,7 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
-"X-Generator: Lokalize 20.12.3\n"
+"X-Generator: Lokalize 22.04.2\n"
 "X-Qt-Contexts: true\n"
 
 #: astroseasons.cpp:139
@@ -355,22 +355,22 @@
 #: lunarphase.cpp:35
 msgctxt "LunarPhase|"
 msgid "Waxing Crescent"
-msgstr ""
+msgstr "Dor??staj??c?? srpek"
 
 #: lunarphase.cpp:37
 msgctxt "LunarPhase|"
 msgid "Waxing Gibbous"
-msgstr ""
+msgstr "Dor??staj??c?? M??s??c"
 
 #: lunarphase.cpp:39
 msgctxt "LunarPhase|"
 msgid "Waning Gibbous"
-msgstr ""
+msgstr "Couvaj??c?? M??s??c"
 
 #: lunarphase.cpp:41
 msgctxt "LunarPhase|"
 msgid "Waning Crescent"
-msgstr ""
+msgstr "Couvaj??c?? srpek"
 
 #: zodiac.cpp:66
 msgctxt "Zodiac|"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/po/eu/libkholidays5_qt.po 
new/kholidays-5.97.0/po/eu/libkholidays5_qt.po
--- old/kholidays-5.96.0/po/eu/libkholidays5_qt.po      2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/po/eu/libkholidays5_qt.po      2022-08-07 
15:24:30.000000000 +0200
@@ -1,31 +1,31 @@
 # Translation for libkholidays5_qt.po to Euskara/Basque (eu).
 # Copyright (C) 2018, Free Software Foundation.
-# Copyright (C) 2019-2021, This file is copyright:
+# Copyright (C) 2019-2022, This file is copyright:
 # This file is distributed under the same license as the original file.
 # KDE euskaratzeko proiektuko arduraduna <xa...@ni.eus>.
 #
 # Translators:
-# I??igo Salvador Azurmendi <xa...@euskalnet.net>, 2018, 2021.
+# I??igo Salvador Azurmendi <xa...@ni.eus>, 2018, 2021, 2022.
 msgid ""
 msgstr ""
 "Project-Id-Version: libkholidays5_qt\n"
 "Report-Msgid-Bugs-To: http://bugs.kde.org\n";
 "POT-Creation-Date: 2015-06-13 09:34+0000\n"
-"PO-Revision-Date: 2021-01-16 16:39+0100\n"
+"PO-Revision-Date: 2022-07-29 13:24+0200\n"
 "Last-Translator: I??igo Salvador Azurmendi <xa...@ni.eus>\n"
 "Language-Team: Basque <kde-i18n...@kde.org>\n"
 "Language: eu\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Lokalize 20.12.1\n"
+"X-Generator: Lokalize 22.04.3\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 "X-Qt-Contexts: true\n"
 
 #: astroseasons.cpp:139
 msgctxt "AstroSeasons|"
 msgid "June Solstice"
-msgstr "Ekaineko solztizioa"
+msgstr "Ekaineko solstizioa"
 
 #: astroseasons.cpp:141
 msgctxt "AstroSeasons|"
@@ -357,22 +357,22 @@
 #: lunarphase.cpp:35
 msgctxt "LunarPhase|"
 msgid "Waxing Crescent"
-msgstr ""
+msgstr "Ilargierdi gorakorra"
 
 #: lunarphase.cpp:37
 msgctxt "LunarPhase|"
 msgid "Waxing Gibbous"
-msgstr ""
+msgstr "Konkordun gorakorra"
 
 #: lunarphase.cpp:39
 msgctxt "LunarPhase|"
 msgid "Waning Gibbous"
-msgstr ""
+msgstr "Konkordun beherakorra"
 
 #: lunarphase.cpp:41
 msgctxt "LunarPhase|"
 msgid "Waning Crescent"
-msgstr ""
+msgstr "Ilargierdi beherakorra"
 
 #: zodiac.cpp:66
 msgctxt "Zodiac|"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/po/se/libkholidays5_qt.po 
new/kholidays-5.97.0/po/se/libkholidays5_qt.po
--- old/kholidays-5.96.0/po/se/libkholidays5_qt.po      2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/po/se/libkholidays5_qt.po      2022-08-07 
15:24:30.000000000 +0200
@@ -332,42 +332,42 @@
 msgid "Unknown"
 msgstr ""
 
-#: lunarphase.cpp:26
+#: lunarphase.cpp:25
 msgctxt "LunarPhase|"
 msgid "New Moon"
 msgstr ""
 
-#: lunarphase.cpp:28
+#: lunarphase.cpp:27
 msgctxt "LunarPhase|"
 msgid "Full Moon"
 msgstr ""
 
-#: lunarphase.cpp:30
+#: lunarphase.cpp:29
 msgctxt "LunarPhase|"
 msgid "First Quarter Moon"
 msgstr ""
 
-#: lunarphase.cpp:32
+#: lunarphase.cpp:31
 msgctxt "LunarPhase|"
 msgid "Last Quarter Moon"
 msgstr ""
 
-#: lunarphase.cpp:36
+#: lunarphase.cpp:35
 msgctxt "LunarPhase|"
 msgid "Waxing Crescent"
 msgstr ""
 
-#: lunarphase.cpp:38
+#: lunarphase.cpp:37
 msgctxt "LunarPhase|"
 msgid "Waxing Gibbous"
 msgstr ""
 
-#: lunarphase.cpp:40
+#: lunarphase.cpp:39
 msgctxt "LunarPhase|"
 msgid "Waning Gibbous"
 msgstr ""
 
-#: lunarphase.cpp:42
+#: lunarphase.cpp:41
 msgctxt "LunarPhase|"
 msgid "Waning Crescent"
 msgstr ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/po/zh_CN/libkholidays5_qt.po 
new/kholidays-5.97.0/po/zh_CN/libkholidays5_qt.po
--- old/kholidays-5.96.0/po/zh_CN/libkholidays5_qt.po   2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/po/zh_CN/libkholidays5_qt.po   2022-08-07 
15:24:30.000000000 +0200
@@ -1,10 +1,9 @@
-# Copyright (C) YEAR This_file_is_part_of_KDE
-# This file is distributed under the same license as the PACKAGE package.
-#
-# Xuetian Weng <xw...@cs.stonybrook.edu>, 2014.
-# Weng Xuetian <wen...@gmail.com>, 2014, 2015, 2016.
 msgid ""
 msgstr ""
+"Project-Id-Version: kdeorg\n"
+"PO-Revision-Date: 2022-07-30 15:54\n"
+"Language-Team: Chinese Simplified\n"
+"Language: zh_CN\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -15,10 +14,6 @@
 "X-Crowdin-Language: zh-CN\n"
 "X-Crowdin-File: /kf5-trunk/messages/kholidays/libkholidays5_qt.pot\n"
 "X-Crowdin-File-ID: 6852\n"
-"Project-Id-Version: kdeorg\n"
-"Language-Team: Chinese Simplified\n"
-"Language: zh_CN\n"
-"PO-Revision-Date: 2022-07-02 10:59\n"
 
 #: astroseasons.cpp:139
 msgctxt "AstroSeasons|"
@@ -168,7 +163,7 @@
 #: holidayregion.cpp:938
 msgctxt "HolidayRegion|Australian Region"
 msgid "South Australia"
-msgstr "???????????????"
+msgstr "???????????????"
 
 #: holidayregion.cpp:940
 msgctxt "HolidayRegion|Australian Region"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kholidays-5.96.0/src/declarative/kholidaysdeclarativeplugin.cpp 
new/kholidays-5.97.0/src/declarative/kholidaysdeclarativeplugin.cpp
--- old/kholidays-5.96.0/src/declarative/kholidaysdeclarativeplugin.cpp 
2022-07-02 17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/src/declarative/kholidaysdeclarativeplugin.cpp 
2022-08-07 15:24:30.000000000 +0200
@@ -58,6 +58,18 @@
         const auto time = KHolidays::SunRiseSet::utcDusk(date.date(), 
latitude, longitude);
         return time.isValid() ? QDateTime(date.date(), time, Qt::UTC) : 
QDateTime();
     }
+    static Q_INVOKABLE bool isPolarDay(const QDateTime &date, double latitude)
+    {
+        return KHolidays::SunRiseSet::isPolarDay(date.date(), latitude);
+    }
+    static Q_INVOKABLE bool isPolarTwilight(const QDateTime &date, double 
latitude)
+    {
+        return KHolidays::SunRiseSet::isPolarTwilight(date.date(), latitude);
+    }
+    static Q_INVOKABLE bool isPolarNight(const QDateTime &date, double 
latitude)
+    {
+        return KHolidays::SunRiseSet::isPolarNight(date.date(), latitude);
+    }
 };
 
 void KHolidaysDeclarativePlugin::registerTypes(const char *uri)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/src/holidayregion.cpp 
new/kholidays-5.97.0/src/holidayregion.cpp
--- old/kholidays-5.96.0/src/holidayregion.cpp  2022-07-02 17:52:24.000000000 
+0200
+++ new/kholidays-5.97.0/src/holidayregion.cpp  2022-08-07 15:24:30.000000000 
+0200
@@ -1079,18 +1079,23 @@
 #if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
 Holiday::List HolidayRegion::holidays(const QDate &startDate, const QDate 
&endDate) const
 {
+    return rawHolidaysWithAstroSeasons(startDate, endDate);
+}
+#endif
+
+Holiday::List HolidayRegion::rawHolidays(const QDate &startDate, const QDate 
&endDate) const
+{
     if (isValid()) {
-        return d->mDriver->parseHolidays(startDate, endDate);
+        return d->mDriver->parseRawHolidays(startDate, endDate);
     } else {
         return Holiday::List();
     }
 }
-#endif
 
 Holiday::List HolidayRegion::rawHolidaysWithAstroSeasons(const QDate 
&startDate, const QDate &endDate) const
 {
     if (isValid()) {
-        return d->mDriver->parseRawHolidays(startDate, endDate);
+        return d->mDriver->parseHolidays(startDate, endDate);
     } else {
         return Holiday::List();
     }
@@ -1099,11 +1104,7 @@
 #if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
 Holiday::List HolidayRegion::holidays(const QDate &date) const
 {
-    if (isValid()) {
-        return d->mDriver->parseHolidays(date);
-    } else {
-        return Holiday::List();
-    }
+    return rawHolidaysWithAstroSeasons(date);
 }
 #endif
 
@@ -1119,11 +1120,7 @@
 #if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
 Holiday::List HolidayRegion::holidays(int calendarYear) const
 {
-    if (isValid()) {
-        return d->mDriver->parseHolidays(calendarYear);
-    } else {
-        return Holiday::List();
-    }
+    return rawHolidaysWithAstroSeasons(calendarYear);
 }
 #endif
 
@@ -1138,11 +1135,7 @@
 
 bool HolidayRegion::isHoliday(const QDate &date) const
 {
-#if KHOLIDAYS_BUILD_DEPRECATED_SINCE(5, 95)
-    const Holiday::List holidayList = holidays(date);
-#else
     const Holiday::List holidayList = rawHolidaysWithAstroSeasons(date);
-#endif
     if (!holidayList.isEmpty()) {
         for (const KHolidays::Holiday &holiday : holidayList) {
             if (holiday.dayType() == Holiday::NonWorkday) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/src/holidayregion.h 
new/kholidays-5.97.0/src/holidayregion.h
--- old/kholidays-5.96.0/src/holidayregion.h    2022-07-02 17:52:24.000000000 
+0200
+++ new/kholidays-5.97.0/src/holidayregion.h    2022-08-07 15:24:30.000000000 
+0200
@@ -228,7 +228,7 @@
     Holiday::List rawHolidaysWithAstroSeasons(const QDate &startDate, const 
QDate &endDate) const;
 
     /**
-     * @since 5.95
+     * @since 5.97
      *
      * Returns the list of holidays that occur between @p startDate and @p 
endDate.
      */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/src/parsers/holidayparserdriver.cpp 
new/kholidays-5.97.0/src/parsers/holidayparserdriver.cpp
--- old/kholidays-5.96.0/src/parsers/holidayparserdriver.cpp    2022-07-02 
17:52:24.000000000 +0200
+++ new/kholidays-5.97.0/src/parsers/holidayparserdriver.cpp    2022-08-07 
15:24:30.000000000 +0200
@@ -48,7 +48,7 @@
 
 Holiday::List HolidayParserDriver::parseHolidays(const QDate &startDate, const 
QDate &endDate, const QString &category)
 {
-    parseRawHolidays(startDate, endDate);
+    parseHolidays(startDate, endDate);
     Holiday::List m_resultListTemp = m_resultList;
     m_resultList.clear();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/src/sunriseset.cpp 
new/kholidays-5.97.0/src/sunriseset.cpp
--- old/kholidays-5.96.0/src/sunriseset.cpp     2022-07-02 17:52:24.000000000 
+0200
+++ new/kholidays-5.97.0/src/sunriseset.cpp     2022-08-07 15:24:30.000000000 
+0200
@@ -208,3 +208,31 @@
 {
     return calcSunEvent(date, latitude, longitude, CivilTwilight, Down);
 }
+
+// see https://en.wikipedia.org/wiki/Solar_zenith_angle
+bool SunRiseSet::isPolarDay(const QDate &date, double latitude)
+{
+    const double t = calcTimeJulianCent(date.toJulianDay());
+    const double solarDec = calcSunDeclination(t);
+    const double maxSolarZenithAngle = 180.0 - std::abs(latitude + solarDec);
+
+    return maxSolarZenithAngle <= 90.0 - Sunrise;
+}
+
+bool SunRiseSet::isPolarTwilight(const QDate &date, double latitude)
+{
+    const double t = calcTimeJulianCent(date.toJulianDay());
+    const double solarDec = calcSunDeclination(t);
+    const double minSolarZenithAngle = std::abs(latitude - solarDec);
+
+    return minSolarZenithAngle > 90.0 - Sunrise && minSolarZenithAngle <= 90.0 
- CivilTwilight;
+}
+
+bool SunRiseSet::isPolarNight(const QDate &date, double latitude)
+{
+    const double t = calcTimeJulianCent(date.toJulianDay());
+    const double solarDec = calcSunDeclination(t);
+    const double minSolarZenithAngle = std::abs(latitude - solarDec);
+
+    return minSolarZenithAngle > 90.0 - CivilTwilight;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/src/sunriseset.h 
new/kholidays-5.97.0/src/sunriseset.h
--- old/kholidays-5.96.0/src/sunriseset.h       2022-07-02 17:52:24.000000000 
+0200
+++ new/kholidays-5.97.0/src/sunriseset.h       2022-08-07 15:24:30.000000000 
+0200
@@ -70,6 +70,42 @@
 */
 KHOLIDAYS_EXPORT QTime utcDusk(const QDate &date, double latitude, double 
longitude);
 
+/**
+  Checks whether it is polar day on day @p date at @p latitude.
+  That is, the sun stays above -0.83?? relative to the horizon at all times.
+  Both sunrise/sunset and dawn/dusk times will be invalid for such a day.
+  @param latitude in degree (-90.0, 90.0)
+  @see isPolarNight(), isPolarTwilight()
+  @see https://en.wikipedia.org/wiki/Midnight_sun
+
+  @since 5.97
+*/
+KHOLIDAYS_EXPORT bool isPolarDay(const QDate &date, double latitude);
+
+/**
+  Checks whether it is polar twilight on day @p date at @p latitude.
+  That is, the sun rises at least above -6?? relative the horizon during the 
day,
+  but remains below -0.83?? at all times. Sunrise/sunset times will be invalid
+  for such a day, but dawn/dusk times will be available.
+  @param latitude in degree (-90.0, 90.0)
+  @see isPolarDay(), isPolarNight()
+  @see https://en.wikipedia.org/wiki/Polar_night
+
+  @since 5.97
+*/
+KHOLIDAYS_EXPORT bool isPolarTwilight(const QDate &date, double latitude);
+
+/**
+  Checks whether it is polar night on day @p date at @p latitude.
+  That is, the sun stays below -6?? relative to the horizon at all times.
+  Both sunrise/sunset and dawn/dusk times will be invalid for such a day.
+  @param latitude in degree (-90.0, 90.0)
+  @see isPolarDay(), isPolarTwilight()
+  @see https://en.wikipedia.org/wiki/Polar_night
+
+  @since 5.97
+*/
+KHOLIDAYS_EXPORT bool isPolarNight(const QDate &date, double latitude);
 }
 
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kholidays-5.96.0/tests/example.qml 
new/kholidays-5.97.0/tests/example.qml
--- old/kholidays-5.96.0/tests/example.qml      2022-07-02 17:52:24.000000000 
+0200
+++ new/kholidays-5.97.0/tests/example.qml      2022-08-07 15:24:30.000000000 
+0200
@@ -42,6 +42,15 @@
         Label {
             text: "Dusk: " + KHolidays.SunRiseSet.utcDusk(new Date(), 
lat.text, lon.text)
         }
+        Label {
+            text: "Polar day: " + KHolidays.SunRiseSet.isPolarDay(new Date(), 
lat.text)
+        }
+        Label {
+            text: "Polar twilight: " + 
KHolidays.SunRiseSet.isPolarTwilight(new Date(), lat.text)
+        }
+        Label {
+            text: "Polar night: " + KHolidays.SunRiseSet.isPolarNight(new 
Date(), lat.text)
+        }
 
         Label {
             text: "Lunar phase: " + KHolidays.Lunar.phaseNameAtDate(new Date())

Reply via email to