Closed andrei-a-papou closed 6 months ago
Uh, nice idea! I like that! Maybe even a mode/option that skips weekends? :thinking:
An option to skip weekends sounds nice, yes! But even the basic ability to increase/decrease due dates would be a big step forward for me.
It would also be great to have a binding to clear the due date as well as to add one -- which could default to, say, tomorrow (or any relative date syntax understood by pter -- the user could just set the right string in the config).
I started putting the changes into the codeberg repo even though they're not released yet. Increase and decrease has been added as well as the skip-weekend.
clear-due
is implemented, too.
Awesome!
I'm testing this and will report any issues. Here's one: calling dec-due
on a task with no due date results in a crash:
[CRITICAL] Pter crashed with exception: list index out of range
File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/curses.py", line 3025, in run_cursesui
window.run()
File "/usr/local/lib/python3.11/dist-packages/cursedspace-1.5.2-py3.11.egg/cursedspace/application.py", line 59, in run
raise exception
File "/usr/local/lib/python3.11/dist-packages/cursedspace-1.5.2-py3.11.egg/cursedspace/application.py", line 52, in run
self.main()
File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/curses.py", line 1753, in main
self.functions[fnc]()
File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/curses.py", line 2739, in do_decrease_due
due = utils.task_parse_due(task.task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/utils.py", line 81, in task_parse_due
return datetime.datetime.strptime(task.attr_due[0], Task.DATE_FMT).date()
~~~~~~~~~~~~~^^^
Calling inc-due
on a task with no due date also crashes pter ("list index out of range") -- but I would expect it to add 1d
.
Same problem with calling clear-due
on a task with no due.
Yeah, when the except
catches ValueError
s but ignores the KeyError
:facepalm: I'll fix it later today.
Meanwhile I was wondering; should inc-due
/dec-due
create a due date in case there isn't one yet? Since it's very easy to remove a due date it might be convenient to create one, too?
I would love to have the ability to quickly create one, yes! But I'm not sure about the defaults.
With inc-due
it seems intuitive -- pter could default to today
and then increment per the config setting. Perhaps dec-due
should default to today
too? Defaulting to something like yesterday
doesn't make much sense to me :) What are your thoughts?
That's kinda what I had in mind, too. Adding a due date in the past for an existing task seems a bit stress-inviting. And if the user really wants that level of stress, they can keep hitting the same key to set the due date as far in the past as they need :shrug:
Sounds good to me!
Alright, crash is fixed and due date creation is added!
Seems to work fine, already using it! Thank you!
It would be great to have bindable commands to adjust due dates by one day forward or back. E.g. when you have a task that can be postponed for tomorrow, one could simply hit the shortcut and voila.
Keys like
[
and]
orCtrl + up/down
could be used for that, for example.I think adjusting due dates is a very common operation so these commands would improve productivity.