Closed simonv3 closed 9 years ago
@simonv3 aced! Well done compadre ;)
@bnvk What are your thoughts on the failing test? Should a search for "Apr" return all Aprils? Or only Aprils of this year?
@simonv3 thanks for asking for clarification. My initial instinct re: this is that we pass a second word like -d april all
or parse a hyphen like -d april-all
what do you think?
Agreed.
I think my expectation is (would be as an outsider too) that "April" would find the most recent April. However! It would have to be the most recent April in the past I think. So say "Jun" today would show me June of 2014, rather than doing June of this year - 2015.
Right. Exactly. That's actually an interesting case (dates in past year) I'm not sure how the code handles at the moment. I actually wonder if we should investigate using another node library at this point or if moment.js will be sufficient
I don't actually know any other date libraries. I can picture how to do this, and it wouldn't be overly complex in moment.
And now with tests for dates!
One of the tests fails because I'm not sure whether when you pass "Apr" as a trim, it should just return stuff for this April, rather than all Aprils.
Thoughts @bnvk?