Re: [Orgmode] Converting dates to org-mode dates

2007-11-12 Thread Bastien
Chris Randle [EMAIL PROTECTED] 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


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


RE: [Orgmode] Converting dates to org-mode dates

2007-11-12 Thread Chris Randle
Bastien wrote:
 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.

Thank you. It works a treat. It also has a potentially useful
side-effect, in that valid inactive time stamps like:

[2007-11-12 ]

are left untouched, which may well be what some people would want,
whereas if my search replace operations leave:

[2007-11-12 xxx]

then they will be updated. And if I want the former style stamps
updated, your code is clear enough that (even!) I can see how to adjust
it.

Thanks again.

-- 
Chris Randle



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode