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 Report] PrewText.DatePicker存在非兼容更新,原来传入时间戳的方式不能使用了 #3394

Closed
1 task done
abchexuzheng opened this issue Sep 14, 2022 · 3 comments · Fixed by #3395
Closed
1 task done

Comments

@abchexuzheng
Copy link

abchexuzheng commented Sep 14, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

原来默认值为时间戳的PrewText.DatePicker组件会显示invalidDate
console.log(moment(1663128450537).format('YYYY-MM-DD')) // 之前formatMomentValue是这样的,可以正常显示格式化后的时间
console.log(moment(1663128450537, 'YYYY-MM-DD').format('YYYY-MM-DD')) // 现在formatMomentValue是这样的,不能正常显示格式化后的时间

What is expected?

可以兼容原来的用法,或者添加更多参数来区分

What is actually happening?

原来默认值为时间戳的组件会显示invalidDate

Package

@formily/antd@2.2.4


fix(next): fix time format moment (#3330)
看了下是这个commit里面对formatMomentValue方法进行了改造,format必须变成了前后一致的情况

@abchexuzheng
Copy link
Author

还有带时区的时间也无法和以前一样正确识别了

@abchexuzheng
Copy link
Author

console.log(moment('2022-09-15T09:56:26.000Z').format('YYYY-MM-DD HH:mm'))

@abchexuzheng
Copy link
Author

@janryWang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant