Skip to content
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

[BUG] Date 类型 @JSONField 格式化无效 #468

Closed
JiakunXu opened this issue Jun 14, 2022 · 2 comments
Closed

[BUG] Date 类型 @JSONField 格式化无效 #468

JiakunXu opened this issue Jun 14, 2022 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@JiakunXu
Copy link

问题描述

使用 FastJsonHttpMessageConverter FastJsonConfig 配置 Date 格式化(yyyy-MM-dd HH:mm:ss),对象 Date 属性配置格式化 @JSONField(format = "yyyy-MM-dd"),结果 @JSONField 配置无效,返回(yyyy-MM-dd HH:mm:ss)格式

Fastjson2 2.0.6 没有这个问题

环境信息

  • 版本信息:[Fastjson2 2.0.7]

重现步骤

    FastJsonConfig fastJsonConfig = new FastJsonConfig();
    fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss");
    @JSONField(format = "yyyy-MM-dd")
    private Date                  date;
@JiakunXu JiakunXu added the bug Something isn't working label Jun 14, 2022
@wenshao
Copy link
Member

wenshao commented Jun 14, 2022

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.8-SNAPSHOT/
问题已经修复,请帮忙用2.0.8-SNAPSHOT验证

@wenshao
Copy link
Member

wenshao commented Jun 25, 2022

https://github.com/alibaba/fastjson2/releases/tag/2.0.8
问题已经修复,请用新版本

@wenshao wenshao closed this as completed Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants