duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Time: "time", "local time", "current local time", etc should show user's time #1641

Closed moollaza closed 9 years ago

moollaza commented 9 years ago

This IA could definitely be improved to show the user's local time for certain queries, such as:

https://duck.co/ia/view/time

iambibhas commented 9 years ago

Just curious, now that we have moment.js support, can't we show the datetime without an api call?

moollaza commented 9 years ago

@iambibhas I don't believe so because the TimeandDate API allows us to search for a specific location, and then they do the work of determining the timezone for that place. I don't believe Moment is capable of doing the location -> timezone piece unless it had a DB of all the world's cities?

iambibhas commented 9 years ago

@moollaza right. I just meant for the local time. But seems like the api takes care of it. never mind.

moollaza commented 9 years ago

Updating this one to high priority -- we'd love for someone to tackle this ASAP :rocket:

iambibhas commented 9 years ago

Couple of issues -

Anyway to prioritize the Time spice instead of them?

moollaza commented 9 years ago

time is being handled by Timer spice

IA's can share triggers, there should be no problems

local time triggers the Maps::Places spice

That's an internal bug. I'll make an issue for them to fix it. While testing you can set signal: high but I'd like to avoid setting that permanently unless we really need to.

iambibhas commented 9 years ago

Just changed the regex handling and it's working on my duckpan. There are cases when the query can return multiple locations and their times, do we need to show all of them in tiles? Or just the first one as text?

moollaza commented 9 years ago

There are cases when the query can return multiple locations and their times, do we need to show all of them in tiles? Or just the first one as text?

Not quite sure what you mean -- can you give an example?

I think we currently operate under the assumption that the first place is the closest. If we can compare the user's city/country to the result and they match it would be ideal.