SHARE
TWEET

Untitled

a guest Jun 20th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defun my/org-insert-date-english ()
  2.   "Insert a date at point using `org-read-date' with its optional argument
  3. of TO-TIME so that the user can customize the date format more easily."
  4.   (interactive)
  5.   (require 'org)
  6.   (let ((time (org-read-date nil 'to-time nil "Date:  ")))
  7.     (insert (format-time-string "(W%W) (%a) %d %b %Y"
  8.                                 time))))
  9.  
  10. ;; Inserts: (W19) (Thu) 16 May 2019
  11.      
  12. (defun my/org-insert-date-german ()
  13.   "Insert a date at point using `org-read-date' with its optional argument
  14. of TO-TIME so that the user can customize the date format more easily."
  15.   (interactive)
  16.   (require 'org)
  17.   (letf ((time (org-read-date nil 'to-time nil "Date:  "))
  18.          (calendar-week-start-day 1)
  19.          (calendar-day-name-array ["Montag" "Dienstag" "Mittwoch" "Donnerstag"
  20.                                    "Freitag" "Samstag" "Sonntag"])
  21.          (calendar-month-name-array ["Januar" "Februar" "März" "April" "Mai" "Juni"
  22.                                      "Juli" "August" "September" "Oktober" "November"
  23.                                      "Dezember"]))
  24.     (insert (format-time-string "(KW%W) (%a) %d. %b %Y"
  25.                                 time))))
  26.  
  27. ;; Inserts: (KW19) (Thu) 16. May 2019
  28. ;; Desired: (KW19) (Donnerstag) 16. Mai 2019
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top