emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org table calc and lisp for hh:mm timetable
@ 2011-03-15 18:32 Martin Halder
  2011-03-15 19:22 ` Eric S Fraga
  0 siblings, 1 reply; 19+ messages in thread
From: Martin Halder @ 2011-03-15 18:32 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

some words of warning: this was written by an Emacs, Org, Lisp and Calc newbie.. and congratulations on converting a vim user btw, org mode is great : )

I was trying to generate a simple table with time format "hh:mm" and auto calculate daily sum.. clocking working time was too much so I thought this would be easy but ended up with the following.. it works but is not beautiful (apply formula twice and same information multiple times) and I would like to get rid of the "hms", "hh" and "mm" columns and therefore call "hmconcat" directly somehow.. Any help is highly appreciated.. 

Thanks,
Martin

| Date             | Start | Lunch |  Back |   End |   Sum | hms       | hh | mm |
|------------------+-------+-------+-------+-------+-------+-----------+----+----|
| [2011-03-01 Tue] | 08:00 | 12:20 | 13:00 | 17:00 | 08:20 | 8@ 20' 0" |  8 | 20 |
#+TBLFM: $6='(hmconcat $8 $9)::$7=time(<2010-01-01 $5>)-time(<2010-01-01 $4>)+time(<2010-01-01 $3>)-time(<2010-01-01 $2>)::$8=hour($7)::$9=minute($7)

(defun hmconcat (hh mm) (interactive)
    (if (> (length hh) 1)
        (setq temp (concat hh ":")) (setq temp (concat "0" hh ":")))
    (if (> (length mm) 1)
        (concat temp mm) (concat temp "0" mm)))

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

end of thread, other threads:[~2011-07-02 11:38 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-15 18:32 org table calc and lisp for hh:mm timetable Martin Halder
2011-03-15 19:22 ` Eric S Fraga
2011-03-15 19:49   ` Martin Halder
2011-03-15 20:37     ` Eric S Fraga
2011-03-15 21:47     ` Christian Moe
2011-03-16  9:22       ` Martin Halder
2011-03-17  7:49         ` Bastien
2011-03-20 17:50           ` Eric Schulte
2011-03-20 19:57             ` Eric S Fraga
2011-03-20 17:50           ` Eric Schulte
2011-03-20 21:00             ` Christian Moe
2011-03-20 23:43               ` Eric Schulte
2011-03-22  4:40                 ` Eric Schulte
2011-03-22  9:36                   ` Christian Moe
2011-03-24  1:18                     ` Eric Schulte
2011-03-24 18:35                       ` Martin Halder
2011-03-22 10:52                   ` Carsten Dominik
2011-07-02 11:38                     ` Bastien
2011-03-16  9:28       ` Eric S Fraga

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).