org-read-date
uses the function calendar
from the calendar.el
library. It is not necessary to be in an org-mode
buffer to use org-read-date
; i.e, the function org-insert-copy-date
should work in just about any buffer that is read-write. The nifty thing about org-read-date
is that you can use the mouse to select a date and exit, or use the minibuffer to select a date (which has some pretty overlays).
(defun org-insert-copy-date ()
"Insert a date at point using `org-read-date' with its optional argument
of TO-TIME so that the user can customize the date format more easily.
Also, copy the time-string to the `kill-ring'."
(interactive)
(require 'org)
(let* ((time (org-read-date nil 'to-time nil "Date: "))
(time-string (format-time-string "%Y-%m-%d" time)))
(kill-new time-string)
(insert time-string)))