hafas-client | JavaScript client for HAFAS public transport APIs | REST library
kandi X-RAY | hafas-client Summary
kandi X-RAY | hafas-client Summary
JavaScript client for HAFAS public transport APIs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of hafas-client
hafas-client Key Features
hafas-client Examples and Code Snippets
const createHafas = require('hafas-client')
const dbProfile = require('hafas-client/p/db')
const createApi = require('.')
const config = {
hostname: 'example.org',
name: 'my-hafas-rest-api',
homepage: 'https://github.com/someone/my-hafas-rest-ap
Community Discussions
Trending Discussions on hafas-client
QUESTION
hi I have a really complicated problem. So I created a new repo for this problem at github. So you can clone it and see what the problem is.
https://github.com/guitar9/hafas-client-example
I am using https://github.com/public-transport/hafas-client in this project to get train and railway station informations.
...ANSWER
Answered 2018-Sep-12 at 13:02The problem is the usage of the Luxon library within hafas-client library. You will see that your code provided in the repo runs fine on iOS and on android only with remote debugging enabled. Why?
When remote debugging is enabled the code does not run in your phone but in the V8 engine of your chrome browser. When the remote debugging is disabled, code runs on your phone, where in case of android, it runs on a JavaScriptCore (JSC) engine from late 2014 that was compiled with custom setup for react native - that can, potentially, deliver different results.
As the luxon docs point out, support for react native on android is limited.
On iOS, react native uses the JSC available from the OS, which also includes intl features. The reason JSC on android does not have int support is that JSC is bundled together with the apk, and compiling it with intl support would increase the apk size by several MB.
With a bit of cutomizations (forking the hafas client) and working around the date problems, I believe you should be able to fix this. You may also use this but beware that you may run into other sorts of issues that may be hard to get help with (for a while, the Expo client used to use the JSC compiled from this repo but they had to stop using the custom build because of some problems).
Alternatively, you may try using intl polyfill
How did I find out? here you'll see that the error object contains a bunch of extra information. When you were logging the error, you were just getting the description
field, but if you log the request
field, you'll see that it contains "outDate": "Invalid DateTime"
. There it is!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install hafas-client
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page