emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with sexp in org-capture-template


From: Kyle Meyer
Subject: Re: help with sexp in org-capture-template
Date: Sun, 05 Apr 2020 20:36:32 +0000

Hi Bala,

Bala Ramadurai <address@hidden> writes:

> I am working on a org-capture-template and one of the entries is a date (30
> days later) I want in European format.
>
> My solution is this:
> | *Due Date*: %(concat (substring (org-read-date nil nil "+30d") 8 10) "-"
> (substring(org-read-date nil nil "+30d") 5 7) "-" (substring(org-read-date
> nil nil "+30d") 0 4)) |
>
> Although this does the job, it is extremely inelegant and only reflects my
> poor knowledge in elisp.
>
> Can any of you please help me in making this code better?

Does the job is the important part :)  One thing you could do that'd
make it a little nicer to my eyes is let-binding

  (org-read-date nil nil "+30d")

result to avoid calling it three times.

Here's another approach:

    (format-time-string "%d-%m-%Y" (time-add (days-to-time 30) nil))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]