Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement basic search interface or range querying #12

Closed
wizonesolutions opened this issue Mar 22, 2013 · 6 comments
Closed

Implement basic search interface or range querying #12

wizonesolutions opened this issue Mar 22, 2013 · 6 comments

Comments

@wizonesolutions
Copy link

I use iDoneThis to keep track of what I did last on the various projects I juggle. Sometimes I last juggled particular projects on days before yesterday and don't remember exactly which. I'd love a way to enter a range of dates and just see all the dones dumped from that timeframe. In fact, when I think about it now, what I'd love is this date-range functionality because then I could just grep after what I'm looking for. If I need better search, I can open a web browser and do it on iDoneThis. But normally I don't need really good search, just something to grep.

It'd be a plus if when in date-range mode every task could be prefixed with the datestamp.

Theoretical invocation and output:

`idone -r -s "four days ago" -e "today"

2013-03-18: Did some awesome stuff.
....
2013-03-22: Posted new issue to pfenwick/idonethis-perl.`

There is probably a neater way to format the command. Maybe just -r "four days ago,today". But I think the underlying meaning of my request is conveyed :)

@pjf
Copy link
Owner

pjf commented Mar 22, 2013

It so happens that IDT only provides a date-range interface, and WebService::Idonethis is providing a stripped-down version that sets the start and end dates to the same day.

So, the steps to make this happen are:

  • Write a get_range method for WS::IDT
  • Reimplement get_day in terms of get_range
  • Update idone to provide ranged searches.
  • Have idone display dates when a ranged search is performed.
  • Figure out what to do if one is trying to add a done on a ranged search. (Probably throw an error.)

Personally I like -r start,end (and of course these should allow human-readable dates).

pjf added a commit that referenced this issue Mar 22, 2013
@wizonesolutions
Copy link
Author

Agree with everything.
On Mar 22, 2013 11:31 AM, "Paul Fenwick" notifications@github.com wrote:

It so happens that IDT only provides a date-range interface, and
WebService::Idonethis is providing a stripped-down version that sets the
start and end dates to the same day.

So, the steps to make this happen are:

  • Write a get_range method for WS::IDT
  • Reimplement get_day in terms of get_range
  • Update idone to provide ranged searches.
  • Have idone display dates when a ranged search is performed.
  • Figure out what to do if one is trying to add a done on a ranged
    search. (Probably throw an error.)

Personally I like -r start,end (and of course these should allow
human-readable dates).


Reply to this email directly or view it on
GitHubhttps://github.com//issues/12#issuecomment-15290039
.

@pjf
Copy link
Owner

pjf commented Mar 22, 2013

Okay, this is done. :)

$ idone -r '1 week ago, today'

[2013-03-15] Chatted with Emma Jane. Mainly about Klingon.
[2013-03-16] Found $20 on my desk. Now I can't find my wallet.
[2013-03-18] Signed up for HabitRPG. I think this has potential.
[2013-03-19] Coded WebService::HabitRPG
[2013-03-19] Found pianobar sucks when you have a shitty network.
[2013-03-21] Went to swing dancing in Nth Melb.

v0.17 is headed to the CPAN now, or you can use the changes in the git repo if you're impatient. :)

@pjf pjf closed this as completed Mar 22, 2013
@pjf
Copy link
Owner

pjf commented Mar 22, 2013

Oh, and be nice with the range searches. I'm pretty sure idonethis don't actually put any restrictions on date ranges. :)

@pjf
Copy link
Owner

pjf commented Mar 22, 2013

And just because I'm exceptionally proud of my command-line right now, I logged this with:

hrpg + issue -l "Added range support to idone"

and gained XP on HabitRPG, added this to my list of completed tasks, and listed all tasks I've done today. :)

@wizonesolutions
Copy link
Author

Yep, it's working well, and I can grep for the stuff I want. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants