cctool

A tool for managing contacts and calendars.
git clone https://git.ce9e.org/cctool.git

commit
e300f902ea7cb7d0a0ffd3868e423a64be03fa46
parent
2d8e09febfb2a53c7a025f0bdf131fa8723295ce
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-05-08 12:06
allow to dump all date types to JSON

Diffstat

M cctool.py 2 +-

1 files changed, 1 insertions, 1 deletions


diff --git a/cctool.py b/cctool.py

@@ -345,7 +345,7 @@ class LDIF(Format):
  345   345 
  346   346 class DateTimeJSONEncoder(json.JSONEncoder):
  347   347 	def default(self, obj):
  348    -1 		if isinstance(obj, datetime):
   -1   348 		if hasattr(obj, 'isoformat'):
  349   349 			return obj.isoformat()
  350   350 		else:
  351   351 			return super(DateTimeJSONEncoder, self).default(obj)