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] Input placeholder for hours always shows as 12-hour clock format #160

Open
MakzaR opened this issue Jan 15, 2025 · 2 comments
Open

Comments

@MakzaR
Copy link

MakzaR commented Jan 15, 2025

Way to reproduce:

  1. Pass HH:mm:ss string to DateField format prop:
return <DateField format={'HH:mm:ss'} ... />
  1. Focus on created field.

Expected:
Input placeholder shows as is.

Actual result:
Input placeholder converts HH to hh.

Attachments:
Screenshot 2025-01-15 at 15 10 31

The bug appears on all components using <DateField>:

  • Date Field
  • Date Picker
  • Relative Date Field
  • Relative Date Picker

I guess, the problem is with getSectionPlaceholder function as it uses hard-coded value from i18n:

@MakzaR
Copy link
Author

MakzaR commented Jan 16, 2025

I've made a PR to fix this, but i can't link it to the issue: #161

@korvin89
Copy link
Contributor

@MakzaR Hi! Sorry for long response.

Here's the deal: the characters that are used to form the placeholder have nothing to do with the actual format that is used for input. That is, for example, hh means that you need to enter two numbers to indicate the hour, and so on. Users of the interfaces that will be built using data-components most likely do not know anything about the difference between the 'HHandhh` formats in moment or dayjs. In this regard, we believe that it seems impractical to complicate the logic in this place, and users should communicate information about the input format in other more accessible ways - hints, using am/pm format, and so on.

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

2 participants