From: Kyle Meyer <kyle@kyleam.com>
To: emacs-orgmode@gnu.org
Cc: jhenahan@me.com
Subject: [PATCH 2/2] org-parse-time-string: Describe time stamp matching behavior
Date: Fri, 28 Dec 2018 16:42:50 -0500 [thread overview]
Message-ID: <20181228214250.800-2-kyle@kyleam.com> (raw)
In-Reply-To: <20181228213627.387-1-kyle@kyleam.com>
* lisp/org-macs.el (org-parse-time-string): Document matching of
YYYY-MM-DD substring.
org-clock-special-range used to pass in <-50001-11-30 Tue 00:00> with
the expectation that the year would be parsed as -50001, not 0001.
Mention this YYYY-MM-DD format assumption in the docstring to help
avoid such cases.
---
lisp/org-macs.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 6da69c75d..9a65360ff 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -1112,7 +1112,9 @@ (defun org-parse-time-string (s &optional nodefault)
If time is not given, defaults to 0:00. However, with optional
NODEFAULT, hour and minute fields are nil if not given.
-Throw an error if S in not a valid Org time string.
+Throw an error if S does not contain a valid Org time string.
+Note that the first match for YYYY-MM-DD will be used (e.g.,
+\"-52000-02-03\" will be taken as \"2000-02-03\").
This should be a lot faster than the `parse-time-string'."
(unless (string-match org-ts-regexp0 s)
--
2.20.0
prev parent reply other threads:[~2018-12-28 21:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 21:36 [PATCH 0/2] org-clock: Simplify `untilnow' range logic Kyle Meyer
2018-12-28 21:42 ` [PATCH 1/2] " Kyle Meyer
2018-12-28 21:42 ` Kyle Meyer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181228214250.800-2-kyle@kyleam.com \
--to=kyle@kyleam.com \
--cc=emacs-orgmode@gnu.org \
--cc=jhenahan@me.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).