emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to avoid time part in date comparisons?
@ 2013-09-12 12:27 Sebastien Vauban
  2013-09-12 12:40 ` Sebastien Vauban
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastien Vauban @ 2013-09-12 12:27 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Suppose you want to make a list of tasks you will have to do tomorrow.

The most logical expression would be "SCHEDULED = tomorrow":

--8<---------------cut here---------------start------------->8---
    (add-to-list 'org-agenda-custom-commands
                 '("1" "Tomorrow"
                   tags-todo "SCHEDULED=\"<+1d>\""
                   ((org-agenda-overriding-header "Tomorrow"))) t)
--8<---------------cut here---------------end--------------->8---

However, you'll "lose" timed tasks such as:

--8<---------------cut here---------------start------------->8---
** TODO Check weekend hours at the gym
   DEADLINE: <2013-09-13 Fri 12:30>
--8<---------------cut here---------------end--------------->8---

Hence, you need to write a more complex expression, like:

--8<---------------cut here---------------start------------->8---
    (add-to-list 'org-agenda-custom-commands
                 '("2" "Tomorrow"
                   tags-todo "SCHEDULED>=\"<+1d>\"+SCHEDULED<\"<+2d>\""
                   ((org-agenda-overriding-header "Tomorrow (full)"))) t)
--8<---------------cut here---------------end--------------->8---

Is there a better way to write such a basic request?

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to avoid time part in date comparisons?
  2013-09-12 12:27 How to avoid time part in date comparisons? Sebastien Vauban
@ 2013-09-12 12:40 ` Sebastien Vauban
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastien Vauban @ 2013-09-12 12:40 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

"Sebastien Vauban" wrote:
> Suppose you want to make a list of tasks you will have to do tomorrow.
>
>     (add-to-list 'org-agenda-custom-commands
>                  '("1" "Tomorrow"
>                    tags-todo "SCHEDULED=\"<+1d>\""
>                    ((org-agenda-overriding-header "Tomorrow"))) t)
>
> However, you'll "lose" timed tasks. Hence, you need to write a more complex
> expression, like:
>
>     (add-to-list 'org-agenda-custom-commands
>                  '("2" "Tomorrow"
>                    tags-todo "SCHEDULED>=\"<+1d>\"+SCHEDULED<\"<+2d>\""
>                    ((org-agenda-overriding-header "Tomorrow (full)"))) t)
>
> Is there a better way to write such a basic request?

BTW, it's the same for "Today", for which we *must* replace the intuitive
expression

--8<---------------cut here---------------start------------->8---
                     tags-todo "SCHEDULED=\"<today>\""
--8<---------------cut here---------------end--------------->8---

by

--8<---------------cut here---------------start------------->8---
                     tags-todo "SCHEDULED<\"<tomorrow>\""
--8<---------------cut here---------------end--------------->8---

if we want to see all today's tasks (including the ones with a "time"
component)...

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-12 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-12 12:27 How to avoid time part in date comparisons? Sebastien Vauban
2013-09-12 12:40 ` Sebastien Vauban

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).