Function: org-colview-construct-allowed-dates

org-colview-construct-allowed-dates is a byte-compiled function defined in org-colview.el.gz.

Signature

(org-colview-construct-allowed-dates S)

Documentation

Construct a list of three dates around the date in S.

This respects the format of the time stamp in S, active or non-active, and also including time or not. S must be just a time stamp, no text around it.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-colview.el.gz
(defun org-colview-construct-allowed-dates (s)
  "Construct a list of three dates around the date in S.
This respects the format of the time stamp in S, active or non-active,
and also including time or not.  S must be just a time stamp, no text
around it."
  (when (and s (string-match (concat "^" org-ts-regexp3 "$") s))
    (let* ((time (org-parse-time-string s 'nodefaults))
	   (active (equal (string-to-char s) ?<))
	   (fmt (org-time-stamp-format (nth 1 time) (not active)))
	   time-before time-after)
      (setf (car time) (or (car time) 0))
      (setf (nth 1 time) (or (nth 1 time) 0))
      (setf (nth 2 time) (or (nth 2 time) 0))
      (setq time-before (copy-sequence time))
      (setq time-after (copy-sequence time))
      (setf (nth 3 time-before) (1- (nth 3 time)))
      (setf (nth 3 time-after) (1+ (nth 3 time)))
      (mapcar (lambda (x) (format-time-string fmt (org-encode-time x)))
	      (list time-before time time-after)))))