summaryrefslogtreecommitdiff
path: root/lisp/ldg-xact.el
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-02-27 10:07:03 -0700
committerCraig Earls <enderw88@gmail.com>2013-02-27 10:07:03 -0700
commit1e3c795935dc5c938b78fc367ee19e1a259b0fb3 (patch)
treea382d04c8edb2444dbb56b7d377c83027180bedd /lisp/ldg-xact.el
parent54f50a7690368aaa6d3fd2bd685484b1552aefcd (diff)
downloadfork-ledger-1e3c795935dc5c938b78fc367ee19e1a259b0fb3.tar.gz
fork-ledger-1e3c795935dc5c938b78fc367ee19e1a259b0fb3.tar.bz2
fork-ledger-1e3c795935dc5c938b78fc367ee19e1a259b0fb3.zip
Update date regex to handles dashes and slashes
Diffstat (limited to 'lisp/ldg-xact.el')
-rw-r--r--lisp/ldg-xact.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/ldg-xact.el b/lisp/ldg-xact.el
index f5a38ef6..8db50df2 100644
--- a/lisp/ldg-xact.el
+++ b/lisp/ldg-xact.el
@@ -106,7 +106,7 @@ within the transaction."
(extents (ledger-find-xact-extents (point)))
(transaction (buffer-substring (car extents) (cadr extents)))
encoded-date)
- (if (string-match "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)" date)
+ (if (string-match ledger-date-regex date)
(setq encoded-date
(encode-time 0 0 0 (string-to-number (match-string 3 date))
(string-to-number (match-string 2 date))
@@ -114,7 +114,7 @@ within the transaction."
(ledger-find-slot encoded-date)
(insert transaction "\n")
(backward-paragraph)
- (re-search-forward "\\([0-9]+\\)/\\([0-9]+\\)/\\([0-9]+\\)")
+ (re-search-forward ledger-date-regex)
(replace-match date)
(re-search-forward "[1-9][0-9]+\.[0-9]+")))