Skip to content

Commit eb1a2f7

Browse files
Merge pull request #37 from linkedconnections/development
v1.2.1
2 parents e8953d7 + 7cd5160 commit eb1a2f7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ To define the URI of the different entities that are referenced in a Linked Conn
6969
"routeFrom": "routes.route_long_name.replace(/\\s/gi, '').split('--')[0];",
7070
"routeTo": "routes.route_long_name.replace(/\\s/gi, '').split('--')[1];",
7171
"routeLabel": "routes.route_short_name + routes.route_id;",
72-
"tripStartTime": "format(trips.startTime, 'YYYYMMDDTHHmm');"
72+
"tripStartTime": "format(trips.startTime, \"YYYYMMDD'T'HHmm\"");"
7373
}
7474
}
7575
```
@@ -106,7 +106,7 @@ Also, depending of your data source, sometimes you would like to have very speci
106106
107107
* If we want to use the `agency_id` defined in `routes.txt`, but only the first part before the `/` (see the example above), then inside `resolve` we can define a variable as `"agency": "routes.agency_id.substring(0, 4);"` and reuse `{agency}` in the URI definitions.
108108
109-
* For formating dates we expose the `format` function from the [`date-fns`](https://date-fns.org/v1.9.0/docs/format) library. We can create specific date formats inside the `resolve` object to be reused in our URIs. For instance `"tripStartTime": "format(trips.startTime, 'YYYYMMDDTHHmm');"`.
109+
* For formating dates we expose the `format` function from the [`date-fns`](https://date-fns.org/v1.9.0/docs/format) library. We can create specific date formats inside the `resolve` object to be reused in our URIs. For instance `"tripStartTime": "format(trips.startTime, \"YYYYMMDD'T'HHmm\");"`.
110110
111111
### The outcome
112112

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gtfsrt2lc",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Converts the GTFS-RT to Linked Connections",
55
"main": "./Gtfsrt2LC.js",
66
"bin": {

test/gtfsrt2lc.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const rt_path = './test/data/realtime_rawdata';
77
const mock_uris = {
88
"stop": "http://irail.be/stations/NMBS/00{stops.stop_id}",
99
"route": "http://irail.be/vehicle/{routes.route_id}",
10-
"trip": "http://irail.be/vehicle/{trips.trip_id}/{trips.startTime(yyyyMMddTHHmm)}",
11-
"connection": "http://irail.be/connections/{headsign}/{connection.departureStop}/{trips.startTime(yyyyMMddTHHmm)}",
10+
"trip": "http://irail.be/vehicle/{trips.trip_id}/{trips.startTime(yyyyMMdd'T'HHmm)}",
11+
"connection": "http://irail.be/connections/{headsign}/{connection.departureStop}/{trips.startTime(yyyyMMdd'T'HHmm)}",
1212
"resolve": {
1313
"headsign": "trips.trip_headsign.replace(/\\s/, '');"
1414
}

uris_template_example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"resolve": {
77
"routeLabel": "routes.route_long_name.replace(/\\s/gi, '');",
88
"tripLabel": "routes.route_short_name + routes.route_id;",
9-
"tripStartTime": "format(trips.startTime, 'yyyyMMddTHHmm');"
9+
"tripStartTime": "format(trips.startTime, \"yyyyMMdd'T'HHmm\");"
1010
}
1111
}

0 commit comments

Comments
 (0)