Repository: MycroftAI/lingua-franca

Issue:
extract_datetime(" ") returns today not None
Clearly this is my favourite method looking at the issues list :yum: 

An empty string passed to `extract_datetime("")` correctly returns `None`.
However a non-empty string that does not contain a date eg `extract_datetime(" ")` returns a datetime of the current day at midnight.

Documentation for the method:
https://mycroft-core.readthedocs.io/en/stable/source/mycroft.util.html#extract-datetime

Discussion:

Patch:
diff --git a/lingua_franca/lang/parse_en.py b/lingua_franca/lang/parse_en.py
index 872c478..2136423 100644
--- a/lingua_franca/lang/parse_en.py
+++ b/lingua_franca/lang/parse_en.py
@@ -1363,7 +1363,7 @@ def extract_datetime_en(string, dateNow, default_time):
             idx += used - 1
             found = True
     # check that we found a date
-    if not date_found:
+    if not date_found():
         return None
 
     if dayOffset is False:


Test patch:
diff --git a/test/test_parse.py b/test/test_parse.py
index a6533cf..c1510d9 100644
--- a/test/test_parse.py
+++ b/test/test_parse.py
@@ -481,6 +481,10 @@ class TestNormalize(unittest.TestCase):
         morning = datetime(2017, 6, 27, 8, 1, 2)
         evening = datetime(2017, 6, 27, 20, 1, 2)
         noonish = datetime(2017, 6, 27, 12, 1, 2)
+        self.assertEqual(
+            extract_datetime('feed the fish'), None)
+        self.assertEqual(
+            extract_datetime(' '), None)
         self.assertEqual(
             extract_datetime('feed fish at 10 o\'clock', morning)[0],
             datetime(2017, 6, 27, 10, 0, 0))