Add JSON decoder for datetime classes.