Skip to content

Commit c4a1444

Browse files
committed
Merge pull request #423 from sergeymetallic/patch-1
Update CalendarSerializer.java
2 parents cf31515 + 9a3bf6c commit c4a1444

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public void serialize(Calendar value, JsonGenerator jgen, SerializerProvider pro
4949
} else if (_customFormat != null) {
5050
// 21-Feb-2011, tatu: not optimal, but better than alternatives:
5151
synchronized (_customFormat) {
52-
jgen.writeString(_customFormat.format(value));
52+
// _customformat cannot parse Calendar, so Date should be passed
53+
jgen.writeString(_customFormat.format(value.getTime()));
5354
}
5455
} else {
5556
provider.defaultSerializeDateValue(value.getTime(), jgen);

0 commit comments

Comments
 (0)