org-table.el: Convert time-stamps to inactive time-stamp so that Calc can handle them correctly
* org-table.el (org-table-eval-formula): Convert time-stamps to inactive time-stamp so that Calc can handle them correctly. Thanks to Daniel E. Doherty for reporting this.
This commit is contained in:
parent
ecdc4d14c8
commit
b1f498487a
|
@ -2604,6 +2604,8 @@ not overwrite the stored one."
|
||||||
duration-output-format) ev))
|
duration-output-format) ev))
|
||||||
(or (fboundp 'calc-eval)
|
(or (fboundp 'calc-eval)
|
||||||
(error "Calc does not seem to be installed, and is needed to evaluate the formula"))
|
(error "Calc does not seem to be installed, and is needed to evaluate the formula"))
|
||||||
|
;; "Inactivate" time-stamps so that Calc can handle them
|
||||||
|
(setq form (replace-regexp-in-string org-ts-regexp3 "<\\1>" form))
|
||||||
(setq ev (if (and duration (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" form))
|
(setq ev (if (and duration (string-match "^[0-9]+:[0-9]+\\(?::[0-9]+\\)?$" form))
|
||||||
form
|
form
|
||||||
(calc-eval (cons form org-tbl-calc-modes) (if numbers 'num)))
|
(calc-eval (cons form org-tbl-calc-modes) (if numbers 'num)))
|
||||||
|
|
Loading…
Reference in New Issue