emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: how to extract start time and end time from the CLOCK:


From: Carsten Dominik
Subject: Re: [Orgmode] Re: how to extract start time and end time from the CLOCK: property
Date: Thu, 4 Sep 2008 08:56:56 +0200


On Sep 3, 2008, at 9:10 PM, Seweryn Kokot wrote:

Carsten Dominik <address@hidden> writes:

Hi Seweryn,

please see

http://thread.gmane.org/gmane.emacs.orgmode/7430/focus=7430

Hi Carsten

Thanks a lot! This is exactly what I wanted. In my case the following
works

(defun my-org-column-cleaner (title value)
  (cond
    ((equal title "Start")
     (if (and value (>= (length value) 40))
         (substring value 16 21)
        nil ; there was no value, or it was a short string
        ))
         ((equal title "End")
     (if (and value (>= (length value) 40))
         (substring value 40 45)
        nil ; there was no value, or it was a short string
        ))
     (t nil)))
(setq org-columns-modify-value-for-display-function 'my-org-column- cleaner)

and

#+COLUMNS: %50ITEM(Action) %8CLOCK(Start) %8CLOCK(End) %7CLOCKSUM(Clocked)


The only problem is that Emacs+orgmode under Linux gives

[2008-08-19 wto 07:26]--[2008-08-19 wto 08:26]

and under Windows I got

[2008-08-05 Wt 11:44]--[2008-08-05 Wt 13:47]

I guess this is caused by the system locales. Is it possible to make it
consistent with some settings in .emacs file?

I don't know how to do this, byt you could use a regular expression to extract the time instead of a fixed substring, like

(if (and value (>= (length value) 40)
         (string-match "[0-9]+:[0-9]+" value))
    (mach-string 0 value)
  nil ; there was no value, or it was a short string


HTH

- Carsten





reply via email to

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