emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: [week?] (was: insert date-stamp for one month)
Date: Sun, 18 Aug 2019 16:33:37 +0200	[thread overview]
Message-ID: <87wofamtku.fsf_-_@mat.ucm.es> (raw)
In-Reply-To: 23897.8759.759508.760331@AGAME7.local

[-- Attachment #1: Type: text/plain, Size: 1112 bytes --]

>>> "TP" == Thomas Plass <thunk2@arcor.de> 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 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

  parent reply	other threads:[~2019-08-18 14:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18  7:58 insert date-stamp for one month Uwe Brauer
2019-08-18 10:02 ` Thomas Plass
2019-08-18 10:21   ` Uwe Brauer
2019-08-18 14:33   ` Uwe Brauer [this message]
2019-08-19 12:29     ` [week?] (was: insert date-stamp for one month) Thomas Plass
2019-08-18 10:26 ` insert date-stamp for one month Ken Mankoff
2019-08-18 10:37   ` Uwe Brauer

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=87wofamtku.fsf_-_@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --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).