Get date occurence

Description

The get-date-occurence function returns the occurence of a given date in a given month and year. It takes one required parameter, a date string in the format 'YYYY-MM-DD', and two optional parameters, inputLocale and useNearest.

Parameters

  • date (required): A string in the format 'YYYY-MM-DD' representing the date to find the occurence of.
  • inputLocale (optional): A string representing the language and culture to use when parsing the date string. The supported values are 'pt', 'nl', 'en', 'de', 'ja', 'zh', and 'fr'. The default value is 'en'.
  • useNearest (optional): A boolean indicating whether to return the nearest occurence of the date if it does not exist in the given month and year. The default value is false.

Examples

get-date-occurence("2010-12-25", inputLocale="en")

Returns: 2023-12-25 (the current year occurrence for this date)

get-date-occurence("2010-12-25", inputLocale="en", useNearest=true)

Returns: 2022-12-25 (example were made in january 2023 so the nearest occurrence is in 2022)