Skip to content

Instantly share code, notes, and snippets.

@hghwng
Created September 6, 2016 03:07
Show Gist options
  • Save hghwng/57d6f62ff48ebdce804927f0451c8a93 to your computer and use it in GitHub Desktop.
Save hghwng/57d6f62ff48ebdce804927f0451c8a93 to your computer and use it in GitHub Desktop.

Revisions

  1. hghwng created this gist Sep 6, 2016.
    13 changes: 13 additions & 0 deletions parse-week.el
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    (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)))
    ))