konsalex / Airport-Autocomplete-JS

Airport Autocomplete Input tag
MIT License
31 stars 18 forks source link

Any way to get DST to determine the continent? #5

Open m33ts4k0z opened 5 years ago

m33ts4k0z commented 5 years ago

Hello and thanks for this library.

I wonder if there is a way to get even the DST from the scrapped data since openflights provide this as well.

Thanks

konsalex commented 5 years ago

Yes for sure this is easy to be done. I cannot include this in the package because fetching extra data like DST means extra loading time.

But you can extract them easily by running airportsFetch.py, and adding one more like unique_airport["DST"] = values[<The DST place>].replace('"', '').strip()

I am curious though how are you going to use DST @m33ts4k0z 🧐

m33ts4k0z commented 5 years ago

Thanks for you answer

I will pass the DST as a data value and I will use it on my controller in order to determine the continent of the airport.

I managed to fix it but there was a small bug in the generated json:

I had to bracket the airports in an {"airports": } otherwise I got an error.

Also did I do it correctly? I replaced the url in index.browser.min.js. Is that the way you meant to do it?