mirror of
https://github.com/HSLdevcom/digitransit-ui
synced 2025-07-07 11:00:37 +02:00
52 lines
1.9 KiB
Markdown
52 lines
1.9 KiB
Markdown
# @digitransit-util/digitransit-util-route-pattern-option-text
|
|
|
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
|
|
## routePatternOptionText
|
|
|
|
<DESCRIPTION>
|
|
|
|
### Parameters
|
|
|
|
- `language` **[String][1]** Language of translation (e.g. 'fi', 'en' or 'sv')
|
|
- `pattern` **[object][2]** JSON object of pattern
|
|
- `isTogglable` **[boolean][3]** Determine what kind of component is shown (div or option)
|
|
|
|
### Examples
|
|
|
|
```javascript
|
|
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][1]** Option text for pattern's route
|
|
|
|
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
|
|
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
|
|
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
|
|
<!-- This file is automatically generated. Please don't edit it directly:
|
|
if you find an error, edit the source file (likely index.js), and re-run
|
|
./scripts/generate-readmes in the digitransit-util project. -->
|
|
|
|
---
|
|
|
|
This module is part of the Digitransit-ui project. It is maintained in the
|
|
[HSLdevcom/digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) repository, where you can create
|
|
PRs and issues.
|
|
|
|
### Installation
|
|
|
|
Install this module individually:
|
|
|
|
```sh
|
|
$ npm install @digitransit-util/digitransit-util-route-pattern-option-text
|
|
```
|
|
|
|
Or install the Digitransit-util module that includes it as a function:
|
|
|
|
```sh
|
|
$ npm install @digitransit-util/digitransit-util
|
|
```
|