emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: Re: Converting dates to org-mode dates
Date: Mon, 12 Nov 2007 15:02:19 +0000	[thread overview]
Message-ID: <871wav33t0.fsf@bzg.ath.cx> (raw)
In-Reply-To: <00c401c8252e$bd513bc0$6a80a8c0@CUBE> (Chris Randle's message of "Mon, 12 Nov 2007 13:20:05 -0000")

"Chris Randle" <chris@amlog.co.uk> 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

  parent reply	other threads:[~2007-11-12 14:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 13:20 Converting dates to org-mode dates Chris Randle
2007-11-12 13:30 ` Rainer Stengele
2007-11-12 15:02 ` Bastien [this message]
2007-11-12 14:45   ` Chris Randle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871wav33t0.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).