diff options
author | Sebastian Christ <rudolfo.christ@gmail.com> | 2016-05-04 16:52:26 +0200 |
---|---|---|
committer | Sebastian Christ <rudolfo.christ@gmail.com> | 2016-05-04 16:52:26 +0200 |
commit | 4eda0d84191dc045cde8261616edad3d15b84a02 (patch) | |
tree | 439c984c0f667bbb5d73bf5df8a8541e41d3a968 /lisp | |
parent | b08c03f05e2cfe7c4071a51075e83221edb24c33 (diff) | |
download | fork-ledger-4eda0d84191dc045cde8261616edad3d15b84a02.tar.gz fork-ledger-4eda0d84191dc045cde8261616edad3d15b84a02.tar.bz2 fork-ledger-4eda0d84191dc045cde8261616edad3d15b84a02.zip |
Consider ISO dates in `ledger-read-date'.
When `ledger-use-iso-dates' is non-nil use ISO date format instead of `ledger-default-date-format'.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ledger-init.el | 2 | ||||
-rw-r--r-- | lisp/ledger-mode.el | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lisp/ledger-init.el b/lisp/ledger-init.el index 0141d2e7..b95c71eb 100644 --- a/lisp/ledger-init.el +++ b/lisp/ledger-init.el @@ -34,6 +34,8 @@ (defvar ledger-default-date-format "%Y/%m/%d") +(defvar ledger-iso-date-format "%Y-%m-%d") + (defun ledger-init-parse-initialization (buffer) "Parse the .ledgerrc file in BUFFER." (with-current-buffer buffer diff --git a/lisp/ledger-mode.el b/lisp/ledger-mode.el index 7e30c350..e77a2b61 100644 --- a/lisp/ledger-mode.el +++ b/lisp/ledger-mode.el @@ -115,7 +115,9 @@ (string= "" date)) (format-time-string (or (cdr (assoc "date-format" ledger-environment-alist)) - ledger-default-date-format)) + (if ledger-use-iso-dates + ledger-iso-date-format + ledger-default-date-format))) date))) (defun ledger-read-string-with-default (prompt default) |