[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] formatting times as HH:MM with leading zeros
From: |
Stephen Eglen |
Subject: |
[Orgmode] formatting times as HH:MM with leading zeros |
Date: |
Wed, 20 Jan 2010 09:51:03 +0000 |
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))))
- [Orgmode] formatting times as HH:MM with leading zeros,
Stephen Eglen <=