[Top][All Lists]

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

Re: [Orgmode] Re: question and use example

From: Nick Dokos
Subject: Re: [Orgmode] Re: question and use example
Date: Wed, 26 Aug 2009 18:32:49 -0400

Benjamin Andresen <address@hidden> wrote:

> Hey Paul,
> Paul Menair <address@hidden> writes:
> > My problem is this.  I populate the fifth field with c-- c-u c-y.  I
> > would be nice if it happened automatically, but that's no big deal.
> > However, I've been going through and manually entering the sixth
> > field, and that does end up being a hassle.
> I whipped something up that should work for you.

Very nice!

There is a simpler approach, but with the disadvantage that
it requires modifications to the structure of the table (iow, I don't
know how to do it with a time range :-) The main simplification is that
it uses built-in functions.

The table looks like this:

|   | date             | client | desc  | start time             | end time     
          | duration in dec |  H:M |
| # | <2009-08-26 Wed> | benny  | foo'd | <2009-08-26 Wed 14:45> | <2009-08-26 
Wed 18:05> |            3.33 | 3:20 |

#+TBLFM: $7=(date(<$6>) - date(<$5>))*24;%.2f :: 
$8='(org-minutes-to-hh:mm-string (round (* $7 60)));N

Note that the primary result is the time interval in decimal hours - the
hh:mm result is derived from that. Note also that the rounding is necessary
because org-minutes-to-hh:mm-string assumes that its argument is an integer
and misbehaves if it is not:

(org-minutes-to-hh:mm-string 73.2) --> "1:00"
(org-minutes-to-hh:mm-string 73) --> "1:13"

I'm sure there are other approaches as well - investigating the built-in
clocking and attendant reports is probably a good idea as well. Bernt
Hansen has some information in his org-mode page[1], and there is a
tutorial about it on worg[2].


[1] http://doc.norang.ca/org-mode.html
[2] http://orgmode.org/worg/org-tutorials/index.php - the tutorial itself
    is at http://sachachua.com/wp/2007/12/30/clocking-time-with-emacs-org/,
    but note that it's 1.5 years old and I don't know whether it's still
    useful or whether it's completely out of date by this time.

reply via email to

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