Repository: horejsek/python-fastjsonschema

Issue:
"date-time" not full supported
e.g.:

```python
>>> import fastjsonschema
>>> fastjsonschema.validate({'type': 'string', 'format': 'date-time'},'2020-09-09T01:01:01+0100')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jens/repos/python-fastjsonschema/fastjsonschema/__init__.py", line 113, in validate
    return compile(definition, handlers, formats, use_default)(data)
  File "<string>", line 8, in validate
fastjsonschema.exceptions.JsonSchemaValueException: data must be date-time
```
Support was added with: https://github.com/horejsek/python-fastjsonschema/pull/7/
But a later refactor seems to remove this.
And there is no test for it: https://github.com/horejsek/python-fastjsonschema/blob/32476cfd4d97f92cae52d686eb471361503bf4ba/tests/test_format.py#L9-L19

Discussion:

Patch:
diff --git a/fastjsonschema/draft04.py b/fastjsonschema/draft04.py
index a5b132b..394f263 100644
--- a/fastjsonschema/draft04.py
+++ b/fastjsonschema/draft04.py
@@ -26,7 +26,7 @@ class CodeGeneratorDraft04(CodeGenerator):
     # vs. 9 ms with a regex! Other modules are also ineffective or not available in standard
     # library. Some regexps are not 100% precise but good enough, fast and without dependencies.
     FORMAT_REGEXS = {
-        'date-time': r'^\d{4}-[01]\d-[0-3]\d(t|T)[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:[+-][0-2]\d:[0-5]\d|z|Z)\Z',
+        'date-time': r'^\d{4}-[01]\d-[0-3]\d(t|T)[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:[+-][0-2]\d:[0-5]\d|[+-][0-2]\d[0-5]\d|z|Z)\Z',
         'email': r'^[^@]+@[^@]+\.[^@]+\Z',
         'hostname': r'^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9])\Z',
         'ipv4': r'^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\Z',


Test patch:
diff --git a/tests/test_format.py b/tests/test_format.py
index f742344..c43abc5 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -14,6 +14,7 @@ exc = JsonSchemaValueException('data must be date-time', value='{data}', name='d
     ('2018-02-05T14:17:10.00Z\n', exc),
     ('2018-02-05T14:17:10.00Z', '2018-02-05T14:17:10.00Z'),
     ('2018-02-05T14:17:10Z', '2018-02-05T14:17:10Z'),
+    ('2020-09-09T01:01:01+0100', '2020-09-09T01:01:01+0100'),
 ])
 def test_datetime(asserter, value, expected):
     asserter({'type': 'string', 'format': 'date-time'}, value, expected)