IMHO, the default JSONEncoder need not be serialized into javascript
Date objects, otherwise it is troublesome when using in non-js
situation. But we can have another subclass, say JSONEncoderForJs, for
that purpose. See also the docstring of JSONEncoder:
To extend this to recognize other objects, subclass and implement
a
``.default()`` method with another method that returns a
serializable
object for ``o`` if possible, otherwise it should call the
superclass
implementation (to raise ``TypeError``).