mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-12-21 05:50:51 +01:00
| .. | ||
| helpers | ||
| CHANGELOG.md | ||
| index.js | ||
| LICENSE-AGPL.txt | ||
| LICENSE-EUPL.txt | ||
| package.json | ||
| README.md | ||
| test.js | ||
@digitransit-util/digitransit-util-route-pattern-option-text
routePatternOptionText
Parameters
languageString Language of translation (e.g. 'fi', 'en' or 'sv')patternobject JSON object of patternisTogglableboolean 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