Improve assert message in date encoder.