Index: trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.h =================================================================== --- trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.h (revision 1131770) +++ trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.h (revision 1131771) @@ -1,49 +1,50 @@ /* This file is part of the kholidays library. Copyright 2010 John Layt This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef TESTHOLIDAYREGION_H #define TESTHOLIDAYREGION_H #include #include "holidays.h" class QString; class QDate; class HolidayRegionTest : public QObject { Q_OBJECT private Q_SLOTS: void testGb(); void testIran(); + void testIsrael(); void testLocations(); void testRegions(); private: void printMetadata( const QString ®ionCode ); void printHolidays( KHolidays::Holiday::List holidays ); void parseRegionCalendarYear( const QString ®ionCode, int year, const QString &calendarType = "gregorian" ); void parseRegionDateRange( const QString ®ionCode, const QDate &startDate, const QDate &endDate ); void parseRegionDate( const QString ®ionCode, const QDate &date ); }; #endif // TESTHOLIDAYREGION_H Index: trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.cpp =================================================================== --- trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.cpp (revision 1131770) +++ trunk/KDE/kdepimlibs/kholidays/tests/testholidayregion.cpp (revision 1131771) @@ -1,149 +1,161 @@ /* This file is part of the kholidays library. Copyright 2010 John Layt This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "testholidayregion.h" #include #include #include #include #include QTEST_KDEMAIN( HolidayRegionTest, NoGUI ) void HolidayRegionTest::printMetadata( const QString ®ionCode ) { KHolidays::HolidayRegion region( regionCode ); if ( region.isValid() ) { kDebug() << "This regionCode = " << region.regionCode(); kDebug() << "Is valid? = " << region.isValid(); kDebug() << "Country code = " << region.countryCode(); kDebug() << "Language code = " << region.languageCode(); kDebug() << "Name = " << region.name(); kDebug() << "Description = " << region.description(); } else { kDebug() << "Not Valid!"; } kDebug() << ""; } void HolidayRegionTest::printHolidays( KHolidays::Holiday::List holidays ) { if ( holidays.count() > 0 ) { foreach ( const KHolidays::Holiday &holiday, holidays ) { kDebug() << "Date = " << holiday.date().toString( Qt::ISODate ) << " Name = " << holiday.text(); } } else { kDebug() << "No holidays"; } } void HolidayRegionTest::parseRegionCalendarYear( const QString ®ionCode, int year, const QString &calendarType ) { kDebug() << "Parsing region = " << regionCode << " year = " << year << " calendar = " << calendarType; KHolidays::HolidayRegion region( regionCode ); KHolidays::Holiday::List holidays = region.holidays( year, calendarType ); printHolidays( holidays ); kDebug() << ""; } void HolidayRegionTest::parseRegionDateRange( const QString ®ionCode, const QDate &startDate, const QDate &endDate ) { kDebug() << "Parsing regionCode = " << regionCode << " start date = " << startDate.toString( Qt::ISODate ) << " end date = " << endDate.toString( Qt::ISODate ); KHolidays::HolidayRegion region( regionCode ); KHolidays::Holiday::List holidays = region.holidays( startDate, endDate ); printHolidays( holidays ); kDebug() << ""; } void HolidayRegionTest::parseRegionDate( const QString ®ionCode, const QDate &date ) { kDebug() << "Parsing regionCode = " << regionCode << " date = " << date.toString( Qt::ISODate ); KHolidays::HolidayRegion region( regionCode ); KHolidays::Holiday::List holidays = region.holidays( date ); printHolidays( holidays ); kDebug() << ""; } void HolidayRegionTest::testGb() { printMetadata( "gb-eaw_en-gb" ); parseRegionDateRange( "gb-eaw_en-gb", QDate( 2010, 7, 1), QDate( 2011, 6, 30 ) ); parseRegionDateRange( "gb-eaw_en-gb", QDate( 2010, 1, 1), QDate( 2012, 12, 31 ) ); parseRegionDateRange( "gb-eaw_en-gb", QDate( 2010, 1, 1), QDate( 2010, 12, 31 ) ); parseRegionCalendarYear( "gb-eaw_en-gb", 2010, "gregorian" ); parseRegionDate( "gb-eaw_en-gb", QDate( 2010, 1, 1 ) ); } void HolidayRegionTest::testIran() { printMetadata( "ir_en-us" ); parseRegionCalendarYear( "ir_en-us", 2010 ); parseRegionCalendarYear( "ir_en-us", 2011 ); parseRegionCalendarYear( "ir_en-us", 2012 ); parseRegionCalendarYear( "ir_en-us", 2013 ); parseRegionCalendarYear( "ir_en-us", 2014 ); parseRegionCalendarYear( "ir_en-us", 2015 ); } +void HolidayRegionTest::testIsrael() +{ + printMetadata( "il_en-us" ); + parseRegionCalendarYear( "il_en-us", 2010 ); + parseRegionCalendarYear( "il_en-us", 2011 ); + parseRegionCalendarYear( "il_en-us", 2012 ); + parseRegionCalendarYear( "il_en-us", 2013 ); + parseRegionCalendarYear( "il_en-us", 2014 ); + parseRegionCalendarYear( "il_en-us", 2015 ); + +} + void HolidayRegionTest::testRegions() { kDebug() << "Available regions:"; QStringList regions = KHolidays::HolidayRegion::regions(); foreach ( const QString ®ionCode, regions ) { KHolidays::HolidayRegion testRegion( regionCode ); kDebug() << regionCode << " = " << testRegion.name(); } kDebug() << ""; kDebug() << "This years holidays:"; foreach ( const QString ®ionCode, regions ) { printMetadata( regionCode ); parseRegionCalendarYear( regionCode, QDate::currentDate().year() ); kDebug() << ""; } kDebug() << ""; } void HolidayRegionTest::testLocations() { kDebug() << "Available locations:"; QStringList locations = KHolidays::HolidayRegion::locations(); foreach ( const QString &location, locations ) { KHolidays::HolidayRegion testRegion( location ); kDebug() << location << " = " << testRegion.regionCode() << testRegion.name(); } kDebug() << ""; } Index: trunk/KDE/kdepimlibs/kholidays/holidays/plan2/holiday_il_he =================================================================== --- trunk/KDE/kdepimlibs/kholidays/holidays/plan2/holiday_il_he (nonexistent) +++ trunk/KDE/kdepimlibs/kholidays/holidays/plan2/holiday_il_he (revision 1131771) @@ -0,0 +1,84 @@ +:: +:: Country: Israel +:: +:: Language: Hebrew +:: +:: Author: John Layt +:: +:: Updated: 2010-05-28 +:: +:: Source: Copy-and-paste from Wikipedia, please correct any errors! +:: http://en.wikipedia.org/wiki/Public_holidays_in_Israel +:: + +:: Metadata +country "IL" +language "he" +:name "optional - defaults to country name" +:description "(please add description in source language) National holiday file for Israel" + +:: Public Holidays +: Rosh Hashanah (New Year) +"ראש השנה" weekend on hebrew tishrey 1 length 2 days +: Yom Kippur (Day of Atonement) +"יום כיפור" weekend on hebrew tishrey 10 +: Sukkot (Feast of Tabernacles) +"סוכות" weekend on hebrew tishrey 15 +: Simchat Torah (Assembly of the Eighth Day) +"שמחת תורה" weekend on hebrew tishrey 22 +: Pesach (Passover) +"פסח" weekend on hebrew nisan 15 +: Shvi'i shel Pesach (Seventh day of Passover) +"שביעי של פסח" weekend on hebrew nisan 21 +: Yom Ha-Atzmaut (Independence Day) +"יום העצמאות" weekend on hebrew iyar 5 +: Shavuot (Pentecost) +"שבועות" weekend on hebrew sivan 6 + +:: Religious Holidays +: Tsom Gedalyah ben Ahikam (Fast Day of Gedaliah ben Ahikam) +"צום גדליה" on hebrew tishrey 3 +: Chol HaMoed (Feast of Tabernacles) +"חול המועד סוכות" on hebrew tishrey 16 length 6 days +: Hanukkah (Feast of Rededication) +"חנוכה" on hebrew kislev 25 length 8 days +: Tsom Asarah b-Tevet (Tenth of Tevet Fast) +"צום עשרה בטבת" on hebrew tevet 10 +: Tu Bishvat (Fifteenth of Shvat) +"טו בשבט" on hebrew shvat 15 +: Ta`anit Ester (Fast of Esther) +"תענית אסתר" on hebrew adar 13 +: Purim (Feast of Esther) +"פורים" on hebrew adar 14 +: Chol HaMoed Pesach (Passover) +"חול המועד פסח" on hebrew nisan 16 length 5 days +: Lag Ba'omer (33rd day of the `Omer) +"לג בעומר" on hebrew iyar 18 +: Tsom Shiva` Asar b-Tamuz (Seventeenth of Tamuz fast) +"שבעה עשר בתמוז" on hebrew tamuz 17 +: Tisha B'Av (Ninth of Av fast/Destruction of the 1st and 2nd Temples) +"תשעה באב" on hebrew av 9 +: Tu B'Av (Fifteenth of Av/Festival of Love) +"טו באב" on hebrew av 15 + +:: Financial + +:: Cultural +: Yom Hazikaron le Yitzhak Rabin (Yitzhak Rabin's Remembrance Day) +"יום הזיכרון ליצחק רבין" on hebrew heshvan 12 +: Yom HaZikaron LaShoah VeLaGevurah (Holocaust Remembrance Day) +"יום הזיכרון לשואה ולגבורה" on hebrew nisan 27 +: Victory Day +"יום הניצחון על גרמניה הנאצית" on may 9 +: Yom Hazikaron (Fallen Soldiers Remembrance Day) +"יום הזיכרון לחללי מערכות ישראל ונפגעי פעולות האיבה" on hebrew iyar 4 +: Yom Herut Yerushalayim (Jerusalem Day) +"יום ירושלים" on hebrew iyar 28 + +:: School + +:: Daylight Saving + +:: Seasons + +:: Name Days Index: trunk/KDE/kdepimlibs/kholidays/holidays/plan2/holiday_il_en-us =================================================================== --- trunk/KDE/kdepimlibs/kholidays/holidays/plan2/holiday_il_en-us (revision 1131770) +++ trunk/KDE/kdepimlibs/kholidays/holidays/plan2/holiday_il_en-us (revision 1131771) @@ -1,102 +1,59 @@ :: :: Country: Israel :: :: Language: US English :: -:: Author: Jonathan Singer -:: Lior Chen +:: Author: John Layt :: -:: Updated: 2002-01-13 +:: Updated: 2010-05-28 :: -:: Source: +:: Source: Copy-and-paste from Wikipedia, please correct any errors! +:: http://en.wikipedia.org/wiki/Public_holidays_in_Israel :: :: Metadata country "IL" language "en_US" :name "optional - defaults to country name" description "National holiday file for Israel" :: Public Holidays +"Rosh Hashanah (New Year)" weekend on hebrew tishrey 1 length 2 days +"Yom Kippur (Day of Atonement)" weekend on hebrew tishrey 10 +"Sukkot (Feast of Tabernacles)" weekend on hebrew tishrey 15 +"Simchat Torah (Assembly of the Eighth Day)" weekend on hebrew tishrey 22 +"Pesach (Passover)" weekend on hebrew nisan 15 +"Shvi'i shel Pesach (Seventh day of Passover)" weekend on hebrew nisan 21 +"Yom Ha-Atzmaut (Independence Day)" weekend on hebrew iyar 5 +"Shavuot (Pentecost)" weekend on hebrew sivan 6 :: Religious Holidays +"Tsom Gedalyah ben Ahikam (Fast Day of Gedaliah ben Ahikam)" on hebrew tishrey 3 +"Chol HaMoed (Feast of Tabernacles)" on hebrew tishrey 16 length 6 days +"Hanukkah (Feast of Rededication)" on hebrew kislev 25 length 8 days +"Tsom Asarah b-Tevet (Tenth of Tevet Fast)" on hebrew tevet 10 +"Tu Bishvat (Fifteenth of Shvat)" on hebrew shvat 15 +"Ta`anit Ester (Fast of Esther)" on hebrew adar 13 +"Purim (Feast of Esther)" on hebrew adar 14 +"Chol HaMoed Pesach (Passover)" on hebrew nisan 16 length 5 days +"Lag Ba'omer (33rd day of the `Omer)" on hebrew iyar 18 +"Tsom Shiva` Asar b-Tamuz (Seventeenth of Tamuz fast)" on hebrew tamuz 17 +"Tisha B'Av (Ninth of Av fast/Destruction of the 1st and 2nd Temples)" on hebrew av 9 +"Tu B'Av (Fifteenth of Av/Festival of Love)" on hebrew av 15 :: Financial :: Cultural +"Yitzhak Rabin's Remembrance Day" on hebrew heshvan 12 +"Holocaust Remembrance Day" on hebrew nisan 27 +"Victory Day" on gregorian may 9 +"Fallen Soldiers Remembrance Day" on hebrew iyar 4 +"Jerusalem Day" on hebrew iyar 28 :: School :: Daylight Saving :: Seasons :: Name Days - - -:: All the following will be re-written once switch to new parser with alternative calendar support - - "Fast: 10th of Tevet" on 5.1.2001 - "Tu BiShvat" on 8.02.2001 - "Fast: Ester" on 8.03.2001 - "Purim" on 9.3.2001 - "Passover" on 8.4.2001 - "Chol Hamoed" on 9.4.2001 length 5 - "2nd Passover" on 14.4.2001 - "Holocaust Rememberance day" on 19.4.2001 - "Memorial day for the IDF Soldiers" on 25.4.2001 - "Independence day" on 26.4.2001 - "Lag BaOmer" on 11.5.2001 - "Jerusalem day" on 21.5.2001 - "Shavuot" on 28.5.2001 - "Fast: 17th of Tamuz" on 08.07.2001 - "Fast: 9th of Av" on 29.07.2001 - "Rosh Hashana" on 18.9.2001 length 2 - "Fast: Gdalya" on 20.9.2001 - "Yom Kippur" on 27.9.2001 - "Succot" on 2.10.2001 - "Chol Hamoed Succot" on 3.10.2001 length 6 - "Simchat Torah" on 9.10.2001 - - "Tu B'Shvat" on 28.01.2002 - "Fast: Esther" on 25.2.2002 - "Purim" on 26.2.2002 - "Passover" on 28.3.2002 - "Chol Hamoed" on 29.3.2002 length 5 - "2nd Passover" on 3.4.2002 - "Holocaust Remembrance day" on 9.4.2002 - "Memorial day for the IDF Soldiers" on 16.4.2002 - "Independence Day" on 17.4.2002 - "Lag BaOmer" on 30.4.2002 - "Jerusalem Day" on 10.5.2002 - "Shavuot" on 17.5.2002 - "Fast: 17th of Tamuz" on 27.6.2002 - "Fast: 9th of Av" on 18.07.2002 - "Rosh Hashana" on 7.9.2002 length 2 - "Fast: Gedalia" on 9.9.2002 - "Yom Kippur" on 16.9.2002 - "Succot" on 21.9.2002 - "Chol Hamoed Succot" on 22.9.2002 length 6 - "Simchat Torah" on 28.9.2002 - "Fast: 10th of Tevet" on 15.12.2002 - - "Tu B'Shvat" on 18.01.2003 - "Fast: Esther" on 17.03.2003 - "Purim" on 18.3.2003 - "Passover" on 17.4.2003 - "Chol Hamoed" on 18.4.2003 length 5 - "2nd Passover" on 23.4.2003 - "Holocaust Remembrance day" on 29.4.2003 - "Memorial day for the IDF Soldiers" on 6.5.2003 - "Independence Day" on 7.5.2003 - "Lag BaOmer" on 20.5.2003 - "Jerusalem Day" on 30.5.2003 - "Shavuot" on 6.6.2003 - "Fast: 17th of Tamuz" on 17.07.2003 - "Fast: 9th of Av" on 7.08.2003 - "Rosh Hashana" on 27.9.2003 length 2 - "Fast: Gedalia" on 29.9.2003 - "Yom Kippur" on 6.10.2003 - "Succot" on 11.10.2003 - "Chol Hamoed Succot" on 12.10.2003 length 6 - "Simchat Torah" on 18.10.2003