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

Allow for setting due dates on tasks #69

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

JordanAdams
Copy link

@JordanAdams JordanAdams commented Aug 8, 2018

Implements #67

Description

Adds a new due: tag to task creation allowing users to specify a due date for the task.

Other Features/Ideas

  • $tb --due @1 6d for updating the due date.
  • $tb -f overdue|today|tomorrow for finding tasks based on due date.
  • Apply medium priority styling to tasks due this week and and high priority styling for tomorrow.
  • Add special date/time definitions for "tomorrow" and "next-week"

Screenshots

Due Date Assignment

image

Colour-Coding

image

@ashinzekene
Copy link
Contributor

Cool! What happens when a task is overdue?

@JordanAdams
Copy link
Author

@ashinzekene Currently there's no logic to handle due dates in the past. However I would imagine the right option here is that we show something like (Due: 2 days ago) or (Due: yesterday). I'll put a fix in the add "ago" for dates in the past :)

@colingm
Copy link

colingm commented Aug 10, 2018

I feel like a due date has some idea of a priority, would it make sense to color things with a due date or to color things that are past due?

@JordanAdams
Copy link
Author

@colingm Totally! I mentioned this above in the PR body :)

Apply medium priority styling to tasks due this week and and high priority styling for tomorrow.

The high priority styling should probably extend to overdue tasks too 👍

@colingm
Copy link

colingm commented Aug 10, 2018

@JordanAdams haha whoops awesome. Yeah overdue would be good. Nice work!

@rjoydip-zz
Copy link

Nice work 👍

@kalexmills
Copy link

May need integrating with #52, which adds an --after flag based on issue creation time. Would be nice to have similar filters based on due date also?

@JordanAdams
Copy link
Author

@kalexmills The discussion around moment vs date-fns in there is interesting. I'll migrate this PR to date-fns off the back of that. The only thing we lose in doing so is .fromNow which provides the nice "in 3 days" formatting. However I've been looking at format.js as a possible alternative :)

I'll also add having a --due to the list :)

@rjoydip-zz
Copy link

@JordanAdams Are you talking about https://github.com/yahoo/intl-relativeformat

@JordanAdams
Copy link
Author

@rjoydip That's the one :)

@@ -192,6 +250,62 @@ class Taskbook {
return data;
}

_filterOverdue(data) {

Choose a reason for hiding this comment

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

I think we could do this date computation natively then why needs an external module.?

return data;
}

_filterToday(data) {

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

For me it's a case of the clarity gained. Under the hood, date-fns is doing very simple date manipulations using the native Date type. I'm not sure why we'd ditch a well tested library in favour of just doing the same implementation within Taskbook?

return data;
}

_filterTomorrow(data) {

Choose a reason for hiding this comment

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

@pannet1
Copy link

pannet1 commented Aug 26, 2019

great addition

is it possible to make a task recurring?

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.

None yet

6 participants