1.1.1 • Published 3 years ago

@digitransit-util/digitransit-util-route-pattern-option-text v1.1.1

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

@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