[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Converting dates to org-mode dates
From: |
Bastien |
Subject: |
Re: [Orgmode] Converting dates to org-mode dates |
Date: |
Mon, 12 Nov 2007 15:02:19 +0000 |
User-agent: |
Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (gnu/linux) |
"Chris Randle" <address@hidden> writes:
> [2007-11-12 Tue] (should be Mon)
>
> As far as I can see, that will stay like this until the date is shifted
> in some way.
>
> Is there any way to parse an entire region/buffer for Org-mode dates and
> refresh their day of the week text?
Maybe you can try this (not heavily tested):
(defun my-update-day-name-in-inactive-time-stamps ()
"Update the abbreviate day name in inactive time-stamps."
(interactive)
(save-excursion
(goto-char (point-min))
(while (re-search-forward
"\\[\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( [a-z]+\\)\\]"
nil t)
(let* ((date (match-string 1))
(day (format-time-string
"%a"
(apply 'encode-time
(save-match-data (org-parse-time-string date))))))
(replace-match (concat "[" date " " day "]") t t)))))
--
Bastien