From 9a3bf6c567e9d118449adaa785cd525762da0a73 Mon Sep 17 00:00:00 2001 From: sergeymetallic Date: Thu, 13 Mar 2014 09:15:08 +0200 Subject: [PATCH] Update CalendarSerializer.java // _customFormat cannot parse Calendar, so Date should be passed --- .../fasterxml/jackson/databind/ser/std/CalendarSerializer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java index 653d7cf841..559da5b340 100644 --- a/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java +++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java @@ -49,7 +49,8 @@ public void serialize(Calendar value, JsonGenerator jgen, SerializerProvider pro } else if (_customFormat != null) { // 21-Feb-2011, tatu: not optimal, but better than alternatives: synchronized (_customFormat) { - jgen.writeString(_customFormat.format(value)); + // _customformat cannot parse Calendar, so Date should be passed + jgen.writeString(_customFormat.format(value.getTime())); } } else { provider.defaultSerializeDateValue(value.getTime(), jgen);