-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bugfix] Java 8 date/time type LocalDateTime
not supported by default
#2486
Conversation
yuluo-yx
commented
Aug 7, 2024
•
edited
Loading
edited
- For [Task] <fix bugs by e2e test> #2485
- refer: [Improve] add unit test #2454 (comment)
Signed-off-by: yuluo-yx <[email protected]>
Perhaps adding @Bean
public Jackson2ObjectMapperBuilderCustomizer customizer() {
return builder -> {
JavaTimeModule javaTimeModule = new JavaTimeModule();
final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSX");
simpleDateFormat.setTimeZone(TimeZone.getDefault());
javaTimeModule.addSerializer(BigDecimal.class, ToStringSerializer.instance);
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX");
javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(formatter));
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(formatter));
builder.modules(javaTimeModule)
.timeZone(TimeZone.getDefault())
.dateFormat(simpleDateFormat)
};
} |
Have you tested this locally to see if it works? |
The example is rough, |
Just to demonstrate how |
cc @tomsun28. Do you have any ideas for this pr |
LocalDateTime
not supported by defaultLocalDateTime
not supported by default
hi, this also related the pr #2251 |
Looks like there's a lot riding on this one. 🥲🥲 |
I'm going to close this pr for now, looking for a better solution in #2454 |