[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [week?] (was: insert date-stamp for one month)
From: |
Uwe Brauer |
Subject: |
[O] [week?] (was: insert date-stamp for one month) |
Date: |
Sun, 18 Aug 2019 16:33:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>>> "TP" == Thomas Plass <address@hidden> writes:
hi
> Hello,
I was wondering could that also be done for a week instead of a month
> (defun Brauer/make-month-timerange (year month)
> (interactive
> (list (string-to-int (read-string "Year: " (int-to-string (nth 5
(decode-time)))))
> (string-to-int (read-string "Month: " (int-to-string (nth 4
(decode-time)))))))
> (let* ((last-day (calendar-last-day-of-month month year))
> (start (list 0 0 0 1 month year))
> (end (list 0 0 0 last-day month year))
> (ts (format "<%d-%02d-%02d %s>--<%d-%02d-%02d %s>"
> year month 1 (format-time-string "%a" (apply
#'encode-time start))
> year month last-day (format-time-string "%a" (apply
#'encode-time end)))))
> (message (substitute-command-keys (concat "Use \\[yank] to yank " ts)))
> (kill-new ts)))
The problem seems to be that there is no function
calendar-last-day-of-week. I tried to play a little around but it seems
difficult.
Anyhow
Uwe Brauer
smime.p7s
Description: S/MIME cryptographic signature