JewcalGetNearestHolidayHebrewDate

The JewcalGetNearestHolidayHebrewDate function gets the next occurence of a holiday of the current/given date.
If the current/given date directly falls on a holiday, then the same date is returned.
An exception is if the current/given date falls on the second day of the holiday - in this case the first day of the holiday is returned.

DWORD JewcalGetNearestHolidayHebrewDate(BOOL fDiaspora, 
                                        BOOL fPostponeShushanPurim,
                                        LPSTR lpNameFile,
                                        LPJEWCALDATE lpHebrewDate,
                                        LPJEWCALDATE lpReturnHebrewDate,
                                        int iReturnHoliday);

Parameters

fDiaspora
If it is TRUE, calculation for Diaspora is used.
If it is FALSE, calculation for Israel is used.

fPostponeShushanPurim
If it is TRUE and when the 15th of Adar in a non-leap year or the 15th of Adar II in a leap year falls on a Saturday, Shushan Purim is postponed to Sunday.
If it is FALSE, Shushan Purim is always calculated on the 15th of Adar in a non-leap year or the 15th of Adar II in a leap year.

lpNameFile
If it is not NULL, it must point to the filename with full path of the NAMES.TXT file.
If it is NULL, the NAMES.TXT file is assumed to have its original name and present in the same directory where JEWCAL.DLL is located.
File format of NAMES.TXT

lpHebrewDate
If it is not NULL, it must point to a JEWCALDATE structure which specifies the Hebrew date to process. If it is NULL, the current date is used.

lpReturnHebrewDate
Must point to a JEWCALDATE structure in which the date of the nearest holiday is returned.

iReturnHoliday
This variable must contain the type of the holiday (JEWCAL_DAY_...) to return

ValueMeaning
JEWCAL_DAY_HOLIDAYHoliday
JEWCAL_DAY_YOMHAZICARONYom-Hazicaron day
JEWCAL_DAY_FASTFast day

Return values

If the function succeeds, the return value is JEWCAL_ERROR_OK.

If the function fails, the return value is other than JEWCAL_ERROR_OK. The function fails if the passed Hebrew date is invalid or if the NAMES.TXT file could not be found.

Remarks

This function is new in version 1.1

See Also

JewcalGetNearestHolidayGregorianDate, JewcalHebrewDateToGregorianDate, JewcalGetHebrewMonthName, JEWCALDATE