Skip to content

Added check to ignore --date-format option for hledger users #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion ledger-exec.el
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ otherwise the error output is displayed and an error is raised."
(apply #'call-process-region
(append (list (point-min) (point-max)
ledger-binary-path nil (list outbuf errfile) nil "-f" "-")
(list "--date-format" ledger-default-date-format)
(when ledger-default-date-format
(list "--date-format" ledger-default-date-format))
args)))))
(if (ledger-exec-success-p exit-code outbuf)
outbuf
Expand Down
8 changes: 5 additions & 3 deletions ledger-init.el
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This variable is automatically populated by
"The date format that ledger uses throughout.
Set this to the value of `ledger-iso-date-format' if you prefer
ISO 8601 dates."
:type 'string
:type '(choice string (const nil))
:package-version '(ledger-mode . "4.0.0")
:group 'ledger)

Expand All @@ -59,11 +59,13 @@ Returns the current date if DATE is nil or not supplied.

If FORMAT is provided, use that as the date format. Otherwise,
use the --input-date-format specified in `ledger-init-file-name',
or if none, use `ledger-default-date-format'."
or if none, use `ledger-default-date-format'. If none of
the previous values exist, use ledger-iso-date-format."
(format-time-string
(or format
(cdr (assoc "input-date-format" ledger-environment-alist))
ledger-default-date-format)
ledger-default-date-format
ledger-iso-date-format)
date))


Expand Down
2 changes: 1 addition & 1 deletion ledger-reconcile.el
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ reconcile-finish will mark all pending posting cleared."
(defcustom ledger-reconcile-default-date-format ledger-default-date-format
"Date format for the reconcile buffer.
Default is `ledger-default-date-format'."
:type 'string
:type '(custom string (const nil))
:group 'ledger-reconcile)

(defcustom ledger-reconcile-target-prompt-string "Target amount for reconciliation "
Expand Down