all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* reporting using timeclock?
@ 2003-09-10  3:54 ASH JAMES
  2003-09-10 13:29 ` Glenn Morris
  2003-09-24 10:17 ` Brendan Halpin
  0 siblings, 2 replies; 3+ messages in thread
From: ASH JAMES @ 2003-09-10  3:54 UTC (permalink / raw)


Is anyone aware of an extension that will summarize a .timelog file,
presenting number of hours worked by project?

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

* Re: reporting using timeclock?
  2003-09-10  3:54 reporting using timeclock? ASH JAMES
@ 2003-09-10 13:29 ` Glenn Morris
  2003-09-24 10:17 ` Brendan Halpin
  1 sibling, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2003-09-10 13:29 UTC (permalink / raw)


ASH JAMES wrote:

> Is anyone aware of an extension that will summarize a .timelog file,
> presenting number of hours worked by project?

Is `timeclock-generate-report' no good (I've never used it)?

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

* Re: reporting using timeclock?
  2003-09-10  3:54 reporting using timeclock? ASH JAMES
  2003-09-10 13:29 ` Glenn Morris
@ 2003-09-24 10:17 ` Brendan Halpin
  1 sibling, 0 replies; 3+ messages in thread
From: Brendan Halpin @ 2003-09-24 10:17 UTC (permalink / raw)


ASH JAMES <james.ash@sbc.com> writes:

> Is anyone aware of an extension that will summarize a .timelog file,
> presenting number of hours worked by project?

A late reply...

If you're into elisp, timeclock's structures are easy to
manipulate, e.g.:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun bhtl-generate-report ()
  (interactive)
  (switch-to-buffer (get-buffer-create "*TC-Report*"))
  (delete-region (point-min) (point-max))
  (let ((stuff (nth 2 (timeclock-log-data))))
    (while stuff
      (let ((project-data (pop stuff))
            (time 0))
        (insert (format "%16s: " (pop project-data)))
        (while project-data
          (let* ((proj-entry (pop project-data)))
                  (incf time  (-
                              (timeclock-time-to-seconds (nth 1 proj-entry))
                              (timeclock-time-to-seconds (nth 0 proj-entry))))))
        (insert (seconds-to-hms time) ?\n)))))

(defun seconds-to-hms (secs)
  (let ((secint (round (ftruncate secs))))
    (format "%02d:%02d:%02d"
            (/ secint 3600)         ;; hours
            (/ (% secint 3600) 60)  ;; seconds
            (% secint 60)))) ;; seconds
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Brendan

PS: comments on my lisp style welcome, as usual.
-- 
Brendan Halpin,  Department of Sociology,  University of Limerick,  Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-390476; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie  http://www.ul.ie/sociology/brendan.halpin.html

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

end of thread, other threads:[~2003-09-24 10:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-10  3:54 reporting using timeclock? ASH JAMES
2003-09-10 13:29 ` Glenn Morris
2003-09-24 10:17 ` Brendan Halpin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.