Created
September 6, 2016 03:07
-
-
Save hghwng/57d6f62ff48ebdce804927f0451c8a93 to your computer and use it in GitHub Desktop.
Org mode: parse week with customizable start of week number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(with-eval-after-load 'org | |
(setq start-week 37) | |
(advice-add 'org-read-date-analyze :around | |
(lambda (original-fun ans org-def org-defdecode) | |
(funcall original-fun | |
(if (string-match "^s\\([0-9]+\\)\\(.*\\)" ans) | |
(concat "w" | |
(number-to-string (+ start-week | |
(string-to-number (match-string 1 ans)))) | |
(match-string 2 ans)) | |
ans) | |
org-def org-defdecode))) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment