bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14613: [PATCH] Make parse_datetime (and therefore `date') handle 'DA


From: Sergio Durigan Junior
Subject: bug#14613: [PATCH] Make parse_datetime (and therefore `date') handle 'DAY MONTH, YEAR'
Date: Sat, 27 Jul 2013 04:01:28 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

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  <address@hidden>
+
+       * 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  <address@hidden>
 
        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
   ;
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]