From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: [PATCH 2/2] org-parse-time-string: Describe time stamp matching behavior Date: Fri, 28 Dec 2018 16:42:50 -0500 Message-ID: <20181228214250.800-2-kyle@kyleam.com> References: <20181228213627.387-1-kyle@kyleam.com> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd06e-0003TC-Hy for emacs-orgmode@gnu.org; Fri, 28 Dec 2018 16:55:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gczuW-0002Bd-Hs for emacs-orgmode@gnu.org; Fri, 28 Dec 2018 16:43:22 -0500 Received: from pb-smtp21.pobox.com ([173.228.157.53]:58263) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gczuR-0001xE-Ia for emacs-orgmode@gnu.org; Fri, 28 Dec 2018 16:43:14 -0500 In-Reply-To: <20181228213627.387-1-kyle@kyleam.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Cc: jhenahan@me.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. =20 -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\"). =20 This should be a lot faster than the `parse-time-string'." (unless (string-match org-ts-regexp0 s) --=20 2.20.0