Giter VIP home page Giter VIP logo

Comments (10)

derhuerst avatar derhuerst commented on August 25, 2024

oops, closed #11 instead of #10

from vbb-rest.

jfilter avatar jfilter commented on August 25, 2024

I tried to find the appropriate repo for this to change it myself, but I was kinda lost with all these different versions and repos.

it's as simple as adding something like this.

departures.sort((a, b) => a.when - b.when)

from vbb-rest.

derhuerst avatar derhuerst commented on August 25, 2024

I thought the departures are ordered already, coming from the VBB API. Can you give me an example?

from vbb-rest.

jfilter avatar jfilter commented on August 25, 2024

screenshot 2016-07-22 13 41 51

Not when there are some delays. They are delivered in the order above.

from vbb-rest.

derhuerst avatar derhuerst commented on August 25, 2024

So you propose sorting by (a, b) => (a.when + a.delay) > (b.when + d.delay)?

from vbb-rest.

jfilter avatar jfilter commented on August 25, 2024

As far as I know, https://transport.rest currently delivers the live data in a.when. So the delay is already taken into account.

from vbb-rest.

derhuerst avatar derhuerst commented on August 25, 2024

So this issue can be closed right?

from vbb-rest.

jfilter avatar jfilter commented on August 25, 2024

No, I mean that to compare two departures, you don't have to add the delay, because: .when = planned departure + delay.

from vbb-rest.

derhuerst avatar derhuerst commented on August 25, 2024

8c08f19 integrates [email protected], which sorts departures.

Please confirm this (i deployed this).

from vbb-rest.

derhuerst avatar derhuerst commented on August 25, 2024

@filter1 btw:

If you query this API from a web service, you'd help me if you passed the identifier option to vbb-client. It will end up in my logs instead of the hash IP address and helps me figure out how my API is being used.

from vbb-rest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.