GNU bug report logs - #14613
Date -- incorrect invalid date

Previous Next

Package: coreutils;

Reported by: "Chris F.A. Johnson" <chris <at> cfajohnson.com>

Date: Thu, 13 Jun 2013 22:26:02 UTC

Severity: wishlist

Full log


Message #13 received at 14613 <at> debbugs.gnu.org (full text, mbox):

From: Sergio Durigan Junior <sergiodj <at> riseup.net>
To: 14613 <at> debbugs.gnu.org
Subject: [PATCH] Make parse_datetime (and therefore `date') handle 'DAY MONTH,
 YEAR'
Date: Sat, 27 Jul 2013 04:01:28 -0300
Hi there,

I have a fix for this issue.  This fix touches Gnulib, but I am sending
it here anyway so you guys can test and make sure it works.

It basically adds a simple production on lib/parse-datetime.y to extend
it in order to correctly handle the proposed date format, i.e., '2 June,
2013'.  It works OK here, but I'd be glad if you could give it a test.
Comments are also obviously welcome.

Thanks,

-- 
Sergio

diff --git a/ChangeLog b/ChangeLog
index 4d73a26..d9d89ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-07-27  Sergio Durigan Junior  <sergiodj <at> riseup.net>
+
+	* lib/parse-datetime.y (date): Add production to handle dates like
+	'27 July, 2013'.  Problem reported for coreutils by Chris F.A.
+	Johnson in <http://bugs.gnu.org/14613>.
+
 2013-07-09  Paul Eggert  <eggert <at> cs.ucla.edu>
 
 	regex: port to --with-included-regex --enable-gcc-warnings non-threaded
diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index 4dce7fa..675ba5c 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -535,6 +535,13 @@ date:
         pc->month = $2;
         pc->year = $3;
       }
+  | tUNUMBER tMONTH ',' tUNUMBER
+      {
+        /* e.g. 2 June, 2013.  */
+        pc->day = $1.value;
+	pc->month = $2;
+	pc->year = $4;
+      }
   | iso_8601_date
   ;
 




This bug report was last modified 11 years and 333 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.