emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* formatting times as HH:MM with leading zeros
@ 2010-01-20  9:51 Stephen Eglen
  2010-01-20 12:59 ` Matt Lundin
  0 siblings, 1 reply; 7+ messages in thread
From: Stephen Eglen @ 2010-01-20  9:51 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Stephen Eglen

Just a small suggestion here.  In the agenda, an entry like:
* <2010-01-20 Wed 09:00-09:30> test

gets formatted as follows:

Wednesday  20 January 2010
               8:00...... ----------------
  test:        9:00- 9:30 test
              10:00...... ----------------

the leading whitespace before '9:00' and '9:30' is needed to align the
times, but having the space after the dash looks odd (at least to my
latex-trained eyes).  Would it be possible to patch org-agenda to put a
leading zero rather than leading whitespace.  With this patch, I see:

Wednesday  20 January 2010
              08:00...... ----------------
  test:       09:00-09:30 test
              10:00...... ----------------


diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a20bec5..77062ed 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4902,6 +4902,7 @@ HH:MM."
 		    (mod h1 24) h1))
 	    (t0 (+ (* 100 h2) m))
 	    (t1 (concat (if (>= h1 24) "+" " ")
+			(if (< t0 1000) "0" "") ;zero-pad times before 10:00
 			(if (< t0 100) "0" "")
 			(if (< t0 10)  "0" "")
 			(int-to-string t0))))

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

end of thread, other threads:[~2010-01-21 15:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-20  9:51 formatting times as HH:MM with leading zeros Stephen Eglen
2010-01-20 12:59 ` Matt Lundin
2010-01-20 17:29   ` Stephen Eglen
2010-01-20 19:02     ` Carsten Dominik
2010-01-20 20:28       ` Stephen Eglen
2010-01-21 15:02         ` Carsten Dominik
2010-01-21 15:17         ` Carsten Dominik

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