From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: A small fix in `org-read-date-analyze' Date: Thu, 17 Mar 2016 12:52:58 +0100 Message-ID: <8760wlgw2t.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agWUZ-0005Ot-CB for emacs-orgmode@gnu.org; Thu, 17 Mar 2016 07:53:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agWUV-0000WT-6V for emacs-orgmode@gnu.org; Thu, 17 Mar 2016 07:53:27 -0400 Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:34458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agWUU-0000WK-TA for emacs-orgmode@gnu.org; Thu, 17 Mar 2016 07:53:23 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 9BB4CA1B8F5 for ; Thu, 17 Mar 2016 12:53:10 +0100 (CET) Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uHUMkcn20QHQ for ; Thu, 17 Mar 2016 12:53:02 +0100 (CET) Received: from localhost (unknown [150.254.76.84]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 7349CA1B8EF for ; Thu, 17 Mar 2016 12:53:02 +0100 (CET) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-Mode mailing list --=-=-= Content-Type: text/plain Hi, I attach a simple patch to enhance handling of two-digit years in `org-read-date-analyze'. (I have the FSF papers signed.) Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Enhance-year-handling.patch >From 6406c46fe1394b107e87012696f058fe5f13215e Mon Sep 17 00:00:00 2001 From: Marcin Borkowski Date: Thu, 17 Mar 2016 12:50:12 +0100 Subject: [PATCH] Enhance year handling * lisp/org.el (org-read-date-analyze): Handle two-digit years with `org-small-year-to-year' instead of just adding 2000 --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 1f06cbd..9b3af05 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17011,7 +17011,7 @@ user." (string-to-number (format-time-string "%Y")))) month (string-to-number (match-string 3 ans)) day (string-to-number (match-string 4 ans))) - (when (< year 100) (setq year (+ 2000 year))) + (when (< year 100) (setq year (org-small-year-to-year year))) (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day) t nil ans))) -- 2.4.3 --=-=-=--