Display which week of the year it is. (An additional feature to the existing calener goodie)

Log in to Vote
15 Votes • 6 Comments
Display which week of the year we're currently in.

It should be an expanding of the current calendar-Goodie.

It should show up, when searching for queries such as, "which week is it" or just "week number".

It would be nice, to be able to see, when a given week is, either in the current year, e.g. by searcing for "week 45", or in the past/future, e.g. by searching for "week 14 <year>".
• posted 5 years and 11 months ago • type: Goodie (Perl functions) In Development

I will work on this one if nobody else has started. My current ideas include these three options:

1 - week current (Shows the current week we are in)
2 - week 45 (Show what week of the current year that will occur or has occurred)
3 - week 14 <year> (Do a look up of when the week will occur or has occurred)
posted by [UserVoice Garrett] • 5 years and 7 months ago Link
Garrett, I don't think anyone else is working on this so please feel free! One suggestion is that a default trigger should be, "week of the year", since that's pretty straightforward and is the most likely query for discoverability.
In general, though, there's no need to get hung up on triggers. We can work with you to expand the trigger space once the instant answer is built, so that it has maximum potential coverage.
posted by [UserVoice Zac] • 5 years and 7 months ago Link
Zac, I have finished writing it. I am having trouble with writing good tests since the output is variable for a few examples. I am also new to using git but I pushed them to the repository I forked which is here: https://github.com/gsquire/zeroclickinfo.... I can change the code like you said to "week of the year." I will submit a pull request once I get more eyes on it and make better tests. I used duckpan query a bunch and it worked for me, but writing it into the t file was tricky.

P.S. How can you or I change that this is "in development?" And thanks for your time and help, much appreciated.
posted by [UserVoice Garrett] • 5 years and 7 months ago Link
Thanks, Garrett---we'll reach out regarding this. Feel free to engage the community on this as well: https://duck.co/
posted by [UserVoice DuckDuckGo Team] • 5 years and 7 months ago Link
Garrett, thanks for making this plugin! Regarding the "in development" status, that's something we handle on our end, as you can see it's now been updated.

Regarding the testing, you can incorporate regular expressions into the tests to handle this kind of scenario. The Dice Goodie's test serves as a great example: https://github.com/duckduckgo/zeroclicki...

Please feel free to make the pull request even if the plugin isn't complete, we can continue discussion about implementation details there as its a little more friendly to code examples, etc.

Thanks again!
posted by [UserVoice Zaahir Moolla] • 5 years and 7 months ago Link
Zaahir, I fixed up those test cases and added the file metadata I didn't have before and made a pull request. :)

Thanks for your help! This is my first go at open source stuff and I hope it works out for Duck Duck Go.
posted by [UserVoice Garrett] • 5 years and 7 months ago Link