Elapsed Time With Exclusions

This action determines how much time has passed since a specified date, with optional filters for excluding weekends, bank holidays and custom dates. It supports all standard time units (years, months, weeks, days, hours, minutes, seconds), but the exclusion filters are applied only when unit is "days".

Bank holidays are sourced from the date-holidays NPM package. Supported countries and holiday types can be found in their documentation. Currently reliable for the UK (GB) and some other countries, but not guaranteed globally.

The result includes (counts) today, but not start day.

For examples:
If today's date is 2025-05-21 and the input date is 2025-05-03:

  • Default (no exclusions): 18
  • Exclude bank holidays (GB): 17 (2025-05-05 is a bank holiday in UK)
  • Exclude weekends: 13

Action Inputs

NameTypeDescription
time_unitStringUnit of time to return. Exclusion filters apply only when unit is "days".
dateStringStart date in ISO 8601 format (YYYY-MM-DD).
exclude_weekendsOptional BooleanIf true, skips Saturdays and Sundays.
exclude_just_sundaysOptional BooleanIf true, skips only Sundays.
exclude_bank_holidaysOptional BooleanIf true, skips bank holidays in the given country_code. Requires country_code.
country_codeOptional StringCountry code in ISO 3166-1 alpha-2 format (e.g., "GB", "US").
custom_holidaysOptional ListDates in YYYY-MM-DD format to exclude as custom holidays.

Action Outputs

NameTypeDescription
successBooleanIndicates if the action completed successfully.
time_pastNumberNumber of days passed, adjusted for exclusions.