40

I have tasks that I do every day (e.g bugzilla triage), but I only do those Monday to friday. Not on the weekends.

When I use something like this:

SCHEDULED: <2015-02-07 Sat ++1d>

It repeats it every day, including weekends. Can I change this?

Leo Ufimtsev
  • 6,240
  • 5
  • 40
  • 48

4 Answers4

32

If you just need a reminder, and don't need to mark them as 'DONE' in your org-file, you could use the calendar integration for these situations.

** Triage Bugzilla Entries 09:00-10:00
   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>

This will insert an entry into your daily agenda for weekdays only, but not a task.

Chris McMahan
  • 2,640
  • 1
  • 17
  • 10
  • 2
    Thanks! To create a task I just set "TODO" in the init of phrase, like the following: ** TODO Daily 13:45-14:00 <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))> – helderburato Sep 21 '20 at 11:37
10

Unfortunately, org-mode doesn't seem to support this in a simple command, but you can replicate this by setting up multiple weekly repeats for the same item like so:

* TODO My task
  SCHEDULED: <2015-02-09 Mon ++1w>
  SCHEDULED: <2015-02-10 Tue ++1w>
  SCHEDULED: <2015-02-11 Wed ++1w>
  SCHEDULED: <2015-02-12 Thu ++1w>
  SCHEDULED: <2015-02-13 Fri ++1w>
tanzoniteblack
  • 664
  • 4
  • 5
  • 9
    There is an issue with this. When I close a task, it moves all the scheduled items forward by a week, not just the one that is due :-/ – Leo Ufimtsev Feb 11 '15 at 14:51
  • 1
    So it does, I don't recall it doing that previously. Best I got for you then is to create a different task for each day (which is even worse): * TODO My Task SCHEDULED: <2015-02-09 Mon ++1w> * TODO My Task SCHEDULED: <2015-02-10 Tue ++1w> etc – tanzoniteblack Feb 12 '15 at 17:16
  • 3
    Thank you for your comment. In the mean time I found a workaround. I schedule it daily, but I make it an org-habbit. So I don't see the task days ahead. On saturday/sunday I don't use my emacs so I see the task next on monday when I get back to the office. Kinda works out well. – Leo Ufimtsev Feb 12 '15 at 17:19
10

One way is to simply have a TODO for each week day, eg:

* TODO My task  
  SCHEDULED: <2015-02-09 Mon ++1w>

* TODO My task  
  SCHEDULED: <2015-02-10 Tue ++1w>

This is different than another answer:

* TODO My task
  SCHEDULED: <2015-02-09 Mon ++1w>
  SCHEDULED: <2015-02-10 Tue ++1w>
  SCHEDULED: <2015-02-11 Wed ++1w>
  SCHEDULED: <2015-02-12 Thu ++1w>
  SCHEDULED: <2015-02-13 Fri ++1w>

Which has an issue, as pointed out by someone:

There is an issue with this. When I close a task, it moves all the scheduled items forward by a week, not just the one that is due :-/

This issue occurs because all timestamps are associated with one TODO.

ironfish
  • 161
  • 3
  • 11
1

There is the Habit Plus package, at https://github.com/myshevchuk/org-habit-plus, which augments the Habits functionality in Org Mode.

See Org Mode Habits in the manual: https://orgmode.org/manual/Tracking-your-habits.html

From the Readme.org at the Habits Plus github page:

Installation

As simple as putting the org-habit-plus.el into the load path and adding org-habit-plus to the org-modules list.

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.

So, first you would enable the Habits module in Org and set your task as a habit, specifying how often it repeats. See the Org manual link above for details.

Then you would install Habits Plus. See the github page for the org-habit-plus.el file.

Then you would add a :HABIT_WEEKDAYS: property to your habit and give that property a value of 1 2 3 4 5 to indicate it should be completed Monday through Friday.

loopernow
  • 11
  • 2
  • Cool, thanks! This is the best answer, and the only one which doesn't compromise on having a single TODO entry which can advance from day to day and skip the weekend! However I think this should be submitted upstream as an additional feature in `org-habit` instead of being kept in a divergent fork which doesn't keep pace with upstream. I've submitted https://github.com/myshevchuk/org-habit-plus/issues/4 about this. – Adam Spiers Jul 11 '23 at 14:03