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

DatePicker兼具性问题-部分机型(ios,iphone11)出现年份不显示的问题 #5959

Closed
mushan520 opened this issue Feb 7, 2023 · 4 comments

Comments

@mushan520
Copy link

Version of antd-mobile

^5.27.0

Operating system and its version

iOS

Browser and its version

safari 15.4.1 和 15.0

Sandbox to reproduce

https://codesandbox.io/s/eloquent-bogdan-38zvx9?file=/src/App.tsx

What happened?

问题: 在使用datepicker中,限制了min和max值,并且再使用min/max值时,通过new Date去转换dayjs,不兼容导致年份没有出来
解决办法:通过dayjs的toDate转换
image

ae4c19a38368eac886efdda7967e532

76cf017e976811679a8e9ae09bae16b

Relevant log output

No response

@mushan520 mushan520 added the bug label Feb 7, 2023
@mushan520
Copy link
Author

iphone11 中使用的new Date,在datepicker中都会有问题,包括value

@x011223
Copy link

x011223 commented Apr 24, 2023

iphone11 中使用的new Date,在datepicker中都会有问题,包括value

试试修改一下格式化使用的分隔符,使用 - 在 ios 中可能会得到 NaN

format("2023/04/24")

@miracles1919
Copy link
Contributor

max/min 要求的就是 Date 类型,看起来是你 dayjs 转换的问题

@miracles1919
Copy link
Contributor

iphone11 中使用的new Date,在datepicker中都会有问题,包括value

我试了下也是正常的:iphone 11 pro max, iOS, v14.7, Safari

image

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

No branches or pull requests

3 participants