digitransit-ui/digitransit-util/packages/digitransit-util-route-pattern-option-text
2025-06-18 14:02:35 +03:00
..
helpers Add Polish translation 2024-06-24 12:12:27 +02:00
CHANGELOG.md Remove conventional commit check 2024-02-08 16:19:51 +02:00
index.js chore: migrate utils from Moment.js 2025-06-18 14:02:35 +03:00
LICENSE-AGPL.txt feat: initial version 2020-02-26 08:52:58 +02:00
LICENSE-EUPL.txt feat: initial version 2020-02-26 08:52:58 +02:00
package.json chore: migrate utils from Moment.js 2025-06-18 14:02:35 +03:00
README.md feat: initial version 2020-02-26 08:52:58 +02:00
test.js chore: migrate utils from Moment.js 2025-06-18 14:02:35 +03:00

@digitransit-util/digitransit-util-route-pattern-option-text

routePatternOptionText

Parameters

  • language String Language of translation (e.g. 'fi', 'en' or 'sv')
  • pattern object JSON object of pattern
  • isTogglable boolean Determine what kind of component is shown (div or option)

Examples

digitransit-util.routePatternOptionText('fi', {"code":"HSL:3002U:0:02","headsign":"Kirkkonummi","stops":[{"name":"Helsinki"},{"name":"Kirkkonummi"}],"tripsForDate":[],"activeDates":["20200221","20200222","20200228","20200229","20200306","20200307"],"rangeFollowingDays":[["20200221","20200222"],["20200228","20200229"],["20200306","20200307"]],"dayDiff":[0,1,6,1,6,1],"dayString":"pe-la","allowedDiff":2,"fromDate":"20200221","untilDate":"-"}, true);
//=Kirkkonummi ➔ Helsinki

Returns String Option text for pattern's route


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-route-pattern-option-text

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

$ npm install @digitransit-util/digitransit-util