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

Add list completed #82

Merged
merged 5 commits into from
Aug 2, 2017
Merged

Conversation

stuartskelton
Copy link
Contributor

This is a working implementation of #67.

I have built upon my earlier work to reduce the redundancy in the date_filter.go file, passing a function that supplies the date to filter on, either the Due date or the CompletedDate (minus the timestamp provided by CompletedDateToDate).

I have renamed the filterToday and filterTomorrow for due filtering to filterDueToday and filterDueTomorrow respectively, in an effort to pass the focus of the filtering down to many levels. (I am happy to amend this view point). The reason I have not done this for 'filterThisWeek' is because I have another PR (#79) that will tidy this up a little.

The todolist.site might also need a little update if this is accepted too.

@gammons
Copy link
Owner

gammons commented Aug 1, 2017

nice, thanks for this! I'll have time to give it a review later today.

@gammons
Copy link
Owner

gammons commented Aug 2, 2017

@stuartskelton code looks great. I love the filterOn function as an argument.

I test drove the code locally, and I think we should include archived todos in the completed list. Once that's done I think we can 🚢 !

@stuartskelton
Copy link
Contributor Author

let me see how I would do this.

@stuartskelton
Copy link
Contributor Author

Ok I think that is it. Im not a 100% happy about how I had to achieve it but I am feeling a refactoring coming on.

@gammons
Copy link
Owner

gammons commented Aug 2, 2017

ah, yeah. I see what you had to do there. Archived todos were designed to be never shown when listing, which is why it's architected the way it is. I think this solution is the right one though.

@gammons
Copy link
Owner

gammons commented Aug 2, 2017

tested locally, this works perfectly. Thanks @stuartskelton !


assert.Equal(0, len(filtered))

// now to complted one and see see what happens
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this comment is necessary, and it also has a typo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah lets remove it 😃

assert.Equal(1, len(filtered))
assert.Equal(1, filtered[0].Id)

// now to complted one and see see what happens
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

@gammons
Copy link
Owner

gammons commented Aug 2, 2017

@stuartskelton 🥇 looks perfect. Thanks for implementing this! I'll do a release this week.

@gammons gammons merged commit c22022d into gammons:master Aug 2, 2017
@NonerKao NonerKao mentioned this pull request Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants