1.0.4 • Published 3 years ago

@digitransit-util/digitransit-util-day-range-allowed-diff v1.0.4

Weekly downloads
174
License
(AGPL-3.0 OR EUPL...
Repository
github
Last release
3 years ago

@digitransit-util/digitransit-util-day-range-allowed-diff

dayRangeAllowedDiff

Finds the allowed diff days between current day and next active day. The result will be the number from 1 to 7.

Parameters

  • arrayOfDayNumbers Array Array of all pattern's unique active dates as Day Of Week (ISO) (e.g. 5,6 = only Friday and Saturday)
  • currentDayNumber number Current date's Day Of Week (ISO) (e.g. 3 = Wednesday)

Examples

digitransit-util.dayRangeAllowedDiff([5,6,5,6,5,6], 3);
//=2

Returns number Allowed diff days between current day and next service day


This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @digitransit-util/digitransit-util-day-range-allowed-diff

Or install the Digitransit-util module that includes it as a function:

$ npm install @digitransit-util/digitransit-util