From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Eglen Subject: formatting times as HH:MM with leading zeros Date: Wed, 20 Jan 2010 09:51:03 +0000 Message-ID: <21605.1263981063@cpc1-cmbg14-2-0-cust6.5-4.cable.virginmedia.com> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXXDT-0005us-7h for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:51:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXXDO-0005tb-7q for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:51:10 -0500 Received: from [199.232.76.173] (port=48464 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXXDO-0005tU-4N for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:51:06 -0500 Received: from ppsw-0.csi.cam.ac.uk ([131.111.8.130]:39626) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXXDN-0001PH-OF for emacs-orgmode@gnu.org; Wed, 20 Jan 2010 04:51:05 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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))))