17

I want to know how can I set a repetitive task for only a range of days of the week, for instance from Monday to Friday only.

  • 1
    AFAIK, org-habit has no support for restricting to certain days of week only. – Juancho Feb 1 '15 at 15:03
8

This special sexp diary entry will repeat the TODO on weekdays:

** TODO On Weekdays
<%%(let ((dayname (calendar-day-of-week date)))(memq dayname '(1 2 3 4 5)))> [2015-02-01 So]
  • This doesn't seem to work properly. While it does cause the event to display in the agenda on weekdays, it doesn't work correctly with the repeating-todo functionality. When I mark the task as DONE, it doesn't return to the TODO state. – blujay Aug 24 '15 at 22:04
  • 3
    The diary sexps are not meant to work with rescheduling. If you depend on this, it's probably easier to set up multiple todo entries, one per weekday. – mutbuerger Aug 26 '15 at 8:31
  • Thanks, but I'm confused: assuming a TODO entry will be marked DONE when it's done, how is a repeating sexp useful if it doesn't cause the TODO to get rescheduled? – blujay Aug 29 '15 at 17:47
  • Citing the Org-mode manual: "the use of diary sexp entries like <%%(diary-float t 42)> in scheduling and deadline timestamps is limited. [...] However, it will show the item on each day where the sexp entry matches". – mutbuerger Aug 30 '15 at 6:21
  • I suppose, then, that you could use an agenda view that displays DONE items, and then manually mark it TODO and then DONE again. Too bad that the sexps can't just work with repeating items. :( – blujay Sep 2 '15 at 7:41
1

https://github.com/oddious/org-habit-plus

What’s this?

The great org-habit module lacks a way to handle a very common type of habits, those that can/may/must be executed only on certain weekdays. There exist several workarounds like creating a habit for each day of interest, but they are less flexible and spoil the beauty of Org.

This little enhancement aims to fill the gap. It’s a fork of the original org-habit module and most of the internals are left untouched.

What works

The desired minimum.

...

How it works

As simple as specifying the weekdays (1 = Monday, 7 = Sunday, space separated), on which a habit is expected to be performed, in the :HABIT_WEEKDAYS: property.

WARNING!!!

Expect consistent behaviour only for “.+”-style habits. The “+”- and “++”-style habits are better, at least for now, to be used the original way.

0

Make a repeating entry for Monday and then use Org's timeshift to create additional entries for Tuesday to Friday.

  • 1
    Humm... could you expand your answer with an example? Thank you! – shackra Feb 1 '15 at 9:06
  • 2
    @shackra For anybody still wondering, I think what he meant is just to create like five entries with the same name in parallel, just with different scheduled times. e.g. this one: emacs.stackexchange.com/questions/26610/… – xji Sep 1 '16 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.