changeset 74039:c00ab73bb294

* textmodes/org.el (org-fix-decoded-time): New function. (org-display-custom-time): Use `org-fix-decoded-time'.
author Carsten Dominik <dominik@science.uva.nl>
date Fri, 17 Nov 2006 16:06:50 +0000
parents b2d48e160d23
children 9a43e539ddae
files lisp/textmodes/org.el
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/org.el	Fri Nov 17 16:06:29 2006 +0000
+++ b/lisp/textmodes/org.el	Fri Nov 17 16:06:50 2006 +0000
@@ -6112,6 +6112,7 @@
 	 (with-hm (and (nth 1 t1) (nth 2 t1)))
 	 (inactive (= (char-before (1- beg)) ?\[))
 	 (tf (funcall (if with-hm 'cdr 'car) org-time-stamp-custom-formats))
+	 (time (org-fix-decoded-time t1))
 	 (time (mapcar (lambda (x) (or x 0)) t1))
 	 (str (org-add-props
 		  (format-time-string
@@ -6127,6 +6128,12 @@
 	  (put-text-property beg end 'end-glyph (make-glyph str)))
       (put-text-property beg end 'display str))))
 
+(defun org-fix-decoded-time (time)
+  "Set 0 instead of nil for the first 6 elements of time.
+Don't touch the rest."
+  (let ((n 0))
+    (mapcar (lambda (x) (if (< (setq n (1+ n)) 7) (or x 0) x)) time)))
+
 (defun org-days-to-time (timestamp-string)
   "Difference between TIMESTAMP-STRING and now in days."
   (- (time-to-days (org-time-string-to-time timestamp-string))