react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Time dropdown AM/PM does not respect timeFormat or dateFormat

Open camslice opened this issue 3 years ago • 4 comments

Describe the bug When specifying a timeFormat or dateFormat such as h:mm a, the time selection dropdown does not respect this formatting and displays "AM/PM" as capitals instead of "am/pm" lowercase.

To Reproduce Steps to reproduce the behavior:

  1. Duplicate the "Select time only" example: example-select-time-only
  2. Set dateFormat as h:mm a
  3. Notice that in the time selection dropdown the "AM/PM" part renders in capitals when it should render as lowercase "am/pm"

Expected behavior When specifying a timeFormat or dateFormat with single a for "AM/PM" such as h:mm a, the time selection dropdown should respect this formatting as display "am/pm" as lowercase.

Screenshots image

Desktop (please complete the following information):

  • OS: macos v10.15.7
  • Browser chrome
  • Version 102

camslice avatar Jun 07 '22 14:06 camslice

+1

msucorey avatar Aug 23 '22 13:08 msucorey

I'm not sure what this uses for the format strings. The documentation is sparse. But this seems to provide a lower-case a.m. and p.m (with the default locale):

timeFormat="h:mm aaaa"

bmaupin avatar Jan 19 '23 16:01 bmaupin

I'm not sure what this uses for the format strings. The documentation is sparse. But this seems to provide a lower-case a.m. and p.m (with the default locale):

timeFormat="h:mm aaaa"

Legend thank you! This is exactly what I was after ("aaa" worked to make "am/pm")

TravisHi avatar Dec 01 '23 01:12 TravisHi