31 #include <KLocalizedString>
34 bool showParsha,
bool showChol,
40 showParsha, showChol, showOmer );
44 bool isLeapYear,
bool useIsraelSettings,
45 int dayNumber,
int year,
46 bool showParsha,
bool showChol,
60 bool isAShabbat = ( weekday == Saturday );
63 if ( ( month == Adar ) && !isLeapYear ) {
71 holidays << i18nc(
"These are Jewish holidays and mostly do not "
72 "have translations. They may have different "
73 "spellings in your language; otherwise, just "
74 "translate the sound to your characters.",
83 holidays << i18n(
"Erev Pesach" );
94 holidays << i18n(
"Sh. HaGadol" );
101 if ( !useIsraelSettings || ( day == 15 ) || ( day == 21 ) ) {
102 holidays << i18n(
"Pesach" );
104 }
else if ( day == 22 ) {
113 holidays << i18n(
"Chol Hamoed" );
120 if ( year > 1948 + 3760 ) {
123 if ( day == 26 || day == 27 ) {
124 holidays << i18n(
"Yom HaShoah" );
128 if ( day == 28 || day == 27 ) {
129 holidays << i18n(
"Yom HaShoah" );
138 holidays << i18n(
"Yom HaShoah" );
145 if ( ( day > 15 ) && showOmer ) {
147 holidays << sfirah( day - 15 );
160 if ( year >= 1948 + 3760 ) {
164 holidays << i18n(
"Yom HaAtzmaut" );
166 holidays << i18n(
"Yom HaZikaron" );
171 holidays << i18n(
"Yom HaAtzmaut" );
180 holidays << i18n(
"Yom HaZikaron" );
181 }
else if ( day == 5 ) {
182 holidays << i18n(
"Yom HaAtzmaut" );
188 if ( year > 1967 + 3760 ) {
190 holidays << i18n(
"Yom Yerushalayim" );
194 holidays << i18n(
"Lag BaOmer" );
197 if ( ( day != 18 ) && showOmer ) {
199 holidays << sfirah( day + 15 );
211 holidays << sfirah( day + 44 );
217 if ( showOmer && !isAShabbat ) {
218 holidays << sfirah( 49 );
220 holidays << i18n(
"Erev Shavuot" );
223 if ( !useIsraelSettings || ( day == 6 ) ) {
224 holidays << i18n(
"Shavuot" );
232 if ( ( !isAShabbat && ( day == 17 ) ) ||
233 ( ( weekday == Sunday ) && ( day == 18 ) ) ) {
234 holidays << i18n(
"Tzom Tammuz" );
239 if ( isAShabbat && ( 3 <= day ) && ( day <= 16 ) ) {
242 holidays << i18n(
"Sh. Hazon" );
244 holidays << i18n(
"Sh. Nahamu" );
246 }
else if ( ( !isAShabbat && ( day == 9 ) ) ||
247 ( ( weekday == Sunday ) && ( day == 10 ) ) ) {
249 holidays << i18n(
"Tisha B'Av" );
254 if ( ( day >= 20 ) && ( day <= 26 ) && isAShabbat ) {
255 holidays << i18n(
"S'lichot" );
256 }
else if ( day == 29 ) {
257 holidays << i18n(
"Erev R.H." );
264 holidays << i18n(
"Rosh Hashana" );
268 holidays << i18n(
"Sh. Shuvah" );
270 holidays << i18n(
"Tzom Gedalia" );
274 if ( weekday == Sunday ) {
275 holidays << i18n(
"Tzom Gedalia" );
283 holidays << i18n(
"Sh. Shuvah" );
287 holidays << i18n(
"Erev Y.K." );
290 holidays << i18n(
"Yom Kippur" );
293 holidays << i18n(
"Erev Sukkot" );
297 if ( !useIsraelSettings || ( day == 15 ) ) {
298 holidays << i18n(
"Sukkot" );
307 holidays << i18n(
"Chol Hamoed" );
311 holidays << i18n(
"Hoshana Rabah" );
314 holidays << i18n(
"Shmini Atzeret" );
317 if ( !useIsraelSettings ) {
318 holidays << i18n(
"Simchat Torah" );
329 holidays << i18n(
"Erev Hanukah" );
330 }
else if ( day >= 25 ) {
331 holidays << i18n(
"Hanukah" );
336 if ( day <= ( kvia == 0 ? 3 : 2 ) ) {
339 holidays << i18n(
"Hanukah" );
340 }
else if ( ( ( day == 10 ) && !isAShabbat ) ||
341 ( ( day == 11 ) && ( weekday == Sunday ) ) ) {
343 holidays << i18n(
"Tzom Tevet" );
352 if ( ( kvia != 0 ) && isAShabbat ) {
353 holidays << i18n(
"Sh. Shirah" );
362 holidays << i18n(
"Sh. Shirah" );
367 holidays << i18n(
"Sh. Shirah" );
369 holidays << i18n(
"Tu B'Shvat" );
372 if ( ( kvia == 0 ) && isAShabbat ) {
373 holidays << i18n(
"Sh. Shirah" );
383 if ( isAShabbat && !isLeapYear ) {
384 holidays << i18n(
"Sh. Shekalim" );
393 holidays << i18n(
"Purim Katan" );
394 }
else if ( ( day >= 25 ) && isAShabbat ) {
396 holidays << i18n(
"Sh. Shekalim" );
404 holidays << i18n(
"Sh. Shekalim" );
411 if ( weekday == Thursday ) {
412 holidays << i18n(
"Ta'anit Ester" );
421 holidays << i18n(
"Sh. Zachor" );
426 holidays << i18n(
"Sh. Zachor" );
428 holidays << i18n(
"Erev Purim" );
431 if ( weekday < Friday ) {
432 holidays << i18n(
"Ta'anit Ester" );
436 holidays << i18n(
"Purim" );
440 holidays << i18n(
"Shushan Purim" );
444 if ( weekday == Sunday ) {
445 holidays << i18n(
"Shushan Purim" );
456 holidays << i18n(
"Sh. Parah" );
466 holidays << i18n(
"Sh. HaHodesh" );
472 if ( isAShabbat && showParsha ) {
480 QString Holiday::sfirah(
int day )
483 buffer + i18n(
" Omer" );
static QStringList findHoliday(HebrewDate hd, bool useIsraelSettings, bool showParsha, bool showChol, bool showOmer)
Given a day of a Hebrew month, figures out all the interesting holidays that correspond to that date...
This class converts dates between the Hebrew and Gregorian (secular) calendars.
static QString findParshaName(int dayNumber, int kvia, bool isLeapYear, bool useIsraelSettings)
Find the parsha for a given day of the year.
QString number(int n, int base)
int hebrewDayNumber() const
bool isOnHebrewLeapYear() const