Time Zone: Support "Time in <time_zone>" queries #4004
Comments
I've already been looking into this one a little in issue 3181 in the Spice repo. It seems to me like the work on that should cover this issue. |
@pjhampton I've got a little bit too much on my plate right now. Could you release this one to the community? I'd be more than happy to talk with whoever takes up the issue about how I was planning to go about things. |
Yeah, of course. Thanks for making me aware @BillyBarbaro! |
@pjhampton I can look into this issue. If okay then assign it to me. |
I am done writing the code for this IA which is showing the time in above time zones mentioned. But there is a problem, I am not able to understand how to write a test file for this IA. Since for example a query "time in pst" has no definite answer as it is meant to change every time. Please suggest how I should be writing the test cases for this IA. I am attaching a picture of my local test from codio setup. |
Also apologies for taking so much time to work on this. I got busy with my regular job. |
I went through the documentation and it shows that I might be able to use regex to test for cases where a random answer is generated but after many tries, I am not able to write it properly. Is there any such IA where regex is used in test case file which I can use as reference? |
I have one more doubt. So "time in" is already a trigger word for time IA. I am not sure how duckduckgo will behave with same trigger words used in 2 IA. |
@pjhampton ^^ |
@shivam99aa For testing, you can mock the time using
We should check the hash and if remainder is not present in it, we should |
This is now live |
Description
Based on user feedback and anonymized search data, DuckDuckGo isn't supporting queries such as "Time in <time_zone>". To further complicate things, the API that we're using for the TimeZone Converter, Location Sunrise/Sunset, and Holiday doesn't support time zone based lookups 😞
Solution
There is no perfect solution here, however, the most brainstormed idea could use a hash that maps time zones to countries and uses the time for a given country to show the time for the specified timezone.
https://en.wikipedia.org/wiki/List_of_time_zones_by_country
We could start off with the most popular as a proof of concept, and scale from there. The most popular time zones include:
Triggers should include:
time in <time_zone>
Time now <time_zone>
<time_zone> now time
People to notify
@duckduckgo/duckduckhack-contributors
Get Started
Resources
Instant Answer Page: To Be Created 🚀
The text was updated successfully, but these errors were encountered: