Jump to content

- Common Helper Functions

- # IsHolidayInGermany()

  Followers 0

  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.

  Parameters

  nFederalState:

  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))

  tCheckDate:

  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
    t.day
    t.month
    t.year

  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.

  Examples

      -- check the current date in the federal state of Nordrhein-Westfalen
      if (IsHolidayInGermany(GSE_BL_NW) == true) then
      	-- do something
      end

      -- 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
      end

  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:

  - IsPublicHolidayAT (Austria, including Federal States)
  - IsPublicHolidayDE (Germany, including Federal States)

  By Tom Wellige

  - May 23, 2022
  Share
  Share
  Followers 0

## 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.