Skip to content

Commit

Permalink
Prep work for #355
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Feb 6, 2025
1 parent af80336 commit 98fc3d0
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected SerializationFeature getTimestampsFeature() {
return SerializationFeature.WRITE_DATES_AS_TIMESTAMPS;
}

protected boolean useTimestamp(SerializerProvider provider) {
protected boolean useTimestamp(SerializerProvider ctxt) {
if (_useTimestamp != null) {
return _useTimestamp.booleanValue();
}
Expand All @@ -232,8 +232,13 @@ protected boolean useTimestamp(SerializerProvider provider) {
}
}
// assume that explicit formatter definition implies use of textual format
return (_formatter == null) && (provider != null)
&& provider.isEnabled(getTimestampsFeature());
return (_formatter == null) && useTimestampFromGlobalDefaults(ctxt);
}

// @since 2.19
protected boolean useTimestampFromGlobalDefaults(SerializerProvider ctxt) {
return (ctxt != null)
&& ctxt.isEnabled(getTimestampsFeature());
}

protected boolean _useTimestampExplicitOnly(SerializerProvider provider) {
Expand Down

0 comments on commit 98fc3d0

Please sign in to comment.