From ba9b7e84189e69c9697bc1a6a7229f3e5ea23fcd Mon Sep 17 00:00:00 2001 From: Jannis R Date: Sat, 18 Nov 2017 10:14:17 +0100 Subject: [PATCH] minor stuff --- index.js | 1 + readme.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d190e036..bc9fba6d 100644 --- a/index.js +++ b/index.js @@ -37,6 +37,7 @@ const createClient = (profile) => { if (!Array.isArray(d.jnyL)) return [] // todo: throw err? const parse = profile.parseDeparture(profile, d.locations, d.lines, d.remarks) return d.jnyL.map(parse) + .sort((a, b) => new Date(a.when) - new Date(b.when)) }) } diff --git a/readme.md b/readme.md index 98e2e808..de67f1d4 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # hafas-client -**A client for HAFAS public transport APIs**. Sort of like [public-transport-enable](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also has customisations for the following transport networks: +**A client for HAFAS public transport APIs**. Sort of like [public-transport-enable](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also contains customisations for the following transport networks: - [Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) – [src](p/db/index.js) @@ -12,7 +12,7 @@ ## Background -There's [a company called HaCon](http://hacon.de) that sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS). It is [used by companies all over Europe](https://gist.github.com/derhuerst/2b7ed83bfa5f115125a5) to server routing and departure information for apps. All those endpoints are similar, with the same terms and API routes, but have slightly different options, filters and enable features. +There's [a company called HaCon](http://hacon.de) that sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS). It is [used by companies all over Europe](https://gist.github.com/derhuerst/2b7ed83bfa5f115125a5) to serve routing and departure information for apps. All those endpoints are similar, with the same terms and API routes, but have slightly different options, filters and enable features. `hafas-client` contains all logic for communicating with these, as well as serialising from and parsing to [FPTF](https://github.com/public-transport/friendly-public-transport-format). Endpoint-specific customisations increase the quality of the returned data. @@ -26,7 +26,7 @@ npm install hafas-client ## Usage -``` +```js const createClient = require('hafas-client') const dbProfile = require('hafas-client/p/db')