Jump to content
  • IsHolidayInGermany()


    Lua   SwxWare v13.10


    This helper function checks if a given date is a federal/public holiday in the given German federal state(s).


    local bHoliday = IsHolidayInGermany(nFederalState, tCheckDate)


    This function returns a boolean value.


    The moving church holidays (Easter) are calculated by the Heiner Lichtenberg formula which extends the original formula by Carl Friedrich Gauss.







    One or more (logical or combined) constants defind for each German federal state:


    GSE_BL_BW   -- Baden-Württemberg
    GSE_BL_BY   -- Bayern
    GSE_BL_BE   -- Berlin
    GSE_BL_BB   -- Brandenburg
    GSE_BL_HB   -- Bremen
    GSE_BL_HH   -- Hamburg
    GSE_BL_HE   -- Hessen
    GSE_BL_MV   -- Mecklenburg-Vorpommern
    GSE_BL_NI   -- Niedersachsen
    GSE_BL_NW   -- Nordrhein-Westfalen
    GSE_BL_RP   -- Rheinland-Pfalz
    GSE_BL_SL   -- Saarland
    GSE_BL_SN   -- Sachsen
    GSE_BL_ST   -- Sachsen-Anhalt
    GSE_BL_SH   -- Schleswig-Holstein
    GSE_BL_TH   -- Thüringen
    GSE_BL_KD   -- Köln/Düsseldorf (Rosenmontag) (NRW is included))





    Optional*. The date that should be checked. You can pass the date in different types and formats:

    • string, in "%d.%m.%Y" format, i.e. DD.MM.YYYY
    • number, in os.date "*t" format
    • table, in the following format


    If the parameter is omitted, the current date (of the script user, according to his time zone settings) will be used. For this you could also use the GSE build-in function CurDate() or the Server Script API function PBXUser.Now().

    * Please note: due to a bug in SwyxWare 13.10 this parameter is not optional yet. In the "Lua based call routing" release version of SwyxWare, this will be fixed.





    -- check the current date in the federal state of Nordrhein-Westfalen
    if (IsHolidayInGermany(GSE_BL_NW) == true) then
    	-- do something
    -- check the current date in the federal states of Bremen and Hamburg
    if (IsHolidayInGermany((GSE_BL_HB | GSE_BL_HH), CurDate()) == true) then
    	-- do something


    You can also use this function directly within the property page of the GSE Evaluate block:








    When using a VBScript based callrouting there are two similar functions for Germany and Austria available:




    Tom Wellige


  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.