From 8ff69d1fd0d6c17a1213543bcb59ee5e640ff9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isabella=20Gross=20Alstr=C3=B6m?= Date: Wed, 16 Feb 2022 09:11:48 +0100 Subject: [PATCH] Update json_encode.py --- custom_components/grocy/json_encode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/grocy/json_encode.py b/custom_components/grocy/json_encode.py index a4482a9..897bd7a 100644 --- a/custom_components/grocy/json_encode.py +++ b/custom_components/grocy/json_encode.py @@ -15,7 +15,7 @@ def default(self, o: Any) -> Any: if isinstance(o, (ProductBarcode, ProductBarcodeData)): return o.barcode - if isinstance(o, datetime): + if isinstance(o, (datetime.datetime, datetime.date, datetime.time)): return o.isoformat() if isinstance(o, set): return list(o)