emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Benjamin Andresen <bandresen@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: question and use example
Date: Wed, 26 Aug 2009 18:32:49 -0400	[thread overview]
Message-ID: <11368.1251325969@alphaville.usa.hp.com> (raw)
In-Reply-To: Message from Benjamin Andresen <bandresen@gmail.com> of "Wed, 26 Aug 2009 22:18:49 +0200." <877hwqpbva.fsf@gmail.com>

Benjamin Andresen <bandresen@gmail.com> wrote:

> Hey Paul,
> 
> Paul Menair <pmenair@gmail.com> 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].

HTH,
Nick

[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	other threads:[~2009-08-26 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-26 16:38 question and use example Paul Menair
2009-08-26 20:18 ` Benjamin Andresen
2009-08-26 22:32   ` Nick Dokos [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11368.1251325969@alphaville.usa.hp.com \
    --to=nicholas.dokos@hp.com \
    --cc=bandresen@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).