Comments (9)
Hmm, yes I guess adding a flag is better than adding a second time parameter like departureTime
, as that's how it usually will be used.
How about timeType
with values departure
and arrival
?
from transport.
I think passing a parameter isDepartureTime=0
is clear to be the arrival time. And isDepartureTime=1
is clear to be the departure.
from transport.
I'd rather name the argument so that it's clear instead of adding an additional parameter.
So have a departuretime and an arrivaltime argument, and throw a 400 error if you get both.
from transport.
@colinfrei: this would mean we have depdate
, deptime
, arrdate
and arrtime
.
I think a parameter isArrivalTime
would be the best, as this defaults to 0
.
from transport.
The downside is that it makes it more magic. in my eyes arguments of which it's obvious what they do are always better than arguments where it's not obvious, even if that means having more arguments.
For example you'd still have the situation where it is like it is now, and you're not sure if arrival or departure is meant.
from transport.
I agree about the magic but i think that in this case, it would be easier for everybody to have some magic.
Think about a simple form where you can set the date/time and select departure or arrival (as the sbb.ch form). then you can handle the date/time the same way, and just add the isArrivalTime if arrival is selected.
Thats also the way, the xmlfahrplan API handles this, so we don't have to fiddle around internally.
Defaulting to departure is the way every fahrplan application handles this. so this is clear for me.
from transport.
Whether the parameter is an isArrivalTime
or isDepartureTime
doesn't really matter for me. However, I agree with benib that there should be one extra parameter and not two changed and two invented ones. And I agree, it should default to departure. So it's indeed smarter to have the default isArrivalTime=0
.
from transport.
+1 This would be a great addition
from transport.
PR merged.
from transport.
Related Issues (20)
- Can't seem to pass transportations to the api HOT 1
- Is there any way to know the price per train section? HOT 1
- Parameter "bike" ignored
- Stationboard for station "Altdorf UR, Spital" always shows Platform null HOT 3
- Bus-connection in Biel always shows whole round-trip and ignores end-station
- 1000/day request limit HOT 1
- Request with isArrivalTime=1 yields connections after the indicated time HOT 3
- The example page for connection search does not work HOT 1
- Train / bus numbers: "products" vs "name" HOT 4
- stationboard app for a KaiOs device
- some stations unavailable (Unterlunkhofen)
- Showcase needs a refresh
- Negative number of transfers: "-1" ; does this have any physical meaning? HOT 4
- Walk time is 'null' in response, but is shown as a valid value on search.ch HOT 2
- Trigger Hafas to put out the arrivial Data?
- Train missed on Stationboard request HOT 2
- Barrier / crossing location, opening and closing HOT 1
- Last connection shown with isArrivalTime=1 is unstable across different values of limit parameter
- Missing train name
- Searching for only direct connections not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transport.