-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatumdag.el
36 lines (31 loc) · 1021 Bytes
/
datumdag.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
;;; Datumdag --- insert specifically formatted timestamp
;; Author: hanktard
;;; Code:
(defun get-stars()
"Print correct number of stars based on org level."
(insert
(make-string
(or
(org-element-property :level (org-element-at-point))
2
)
?* )
)
)
(defun datum-dag()
"Print date and day."
(interactive)
(setq datum (format-time-string (concat (get-stars) " %d/%m %A")))
(setq datum (replace-regexp-in-string "Monday" "Måndag" datum))
(setq datum (replace-regexp-in-string "Tuesday" "Tisdag" datum))
(setq datum (replace-regexp-in-string "Wednesday" "Onsdag" datum))
(setq datum (replace-regexp-in-string "Thursday" "Torsdag" datum))
(setq datum (replace-regexp-in-string "Friday" "Fredag" datum))
(setq datum (replace-regexp-in-string "Saturday" "Lördag" datum))
(setq datum (replace-regexp-in-string "Sunday" "Söndag" datum))
(insert datum)
(org-clock-in)
)
;;; Commentary:
;; Insert timestamp formatted to fit an org list.
;;; datumdag.el ends here