ant-design Date Picker Not Supporting 12 Hour Format, (hh value) when entering date manually

w6mmgewl  于 3个月前  发布在  其他
关注(0)|答案(3)|浏览(45)

Steps to reproduce

Choose the date format in the selector to hh:mm a and try to enter the date manually, when we try to enter the hour in time then the focus does not appear on the "hh" field mask.

What is expected?

It should accept the 12-hour format, and hour values while entering the date time manually in the field.

What is actually happening?

It is not accepting the hour values when we pass the prop use12Hours true and the format of hh:mm a
| Environment | Info |
| ------------ | ------------ |
| antd | 5.16.5 |
| React | 18.2.0 |
| System | Windows |
| Browser | Chrome |

jq6vz3qz

jq6vz3qz1#

I originally thought it was a bug, but then I recalled that this was done intentionally. This is because in different locales, 'A' varies in length, for example, in Chinese, it is not only represented by AM and PM. Depending on the time, there can be various representations such as 凌晨早上上午中午下午晚上 . Therefore, this is not an operation that can be simply handled by using a mask to fill in.

rmbxnbpk

rmbxnbpk2#

We actually want this requirement for our project and we are using default locales. We also tried to add custom input component but we are facing issues with the picker Code: https://prnt.sc/bPtC-zYc8fFF Error Stack: https://prnt.sc/PC9BHMNhcVmn Please suggest some solution so that we can implement this functionality in our project.…

On Wed, Jun 5, 2024 at 3:17 PM 二货爱吃白萝卜 ***@***.***> wrote: I originally thought it was a bug, but then I recalled that this was done intentionally. This is because in different locales, 'A' varies in length, for example, in Chinese, it is not only represented by AM and PM. Depending on the time, there can be various representations such as 凌晨 早上 上午 中午 下午 晚上. Therefore, this is not an operation that can be simply handled by using a mask to fill in. — Reply to this email directly, view it on GitHub <#49254 (comment)>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/A5SHMJZG5AWXGCDRBC2OMVTZF3NDLAVCNFSM6AAAAABI2I5XCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBZGM3DGNRYG4 > . You are receiving this because you authored the thread.Message ID: ***@***.***>

omvjsjqw

omvjsjqw3#

Should we support parse as InputNumber?

相关问题