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

default value for dateFormatCalendar is not suitable for japanese locale

Open arnauddem opened this issue 3 years ago • 8 comments

Default value for dateFormatCalendar is 'LLLL yyyy' (ie June 2020), if used with japanese locale it produce the text '7月 2020' whereas expected text is '2020年 7月'. It's strange specially when uses dateFormat="P".

To Reproduce Steps to reproduce the behavior:

  1. set locale to 'ja'
  2. Use :
 <DatePicker
        onChange={(r: any) => ()}
        dateFormat="P"
        minDate={new Date()}
        fixedHeight
      />
  1. calendar input shows '2020/07/16' which is localized
  2. open calendar, the top date is '7月 2020' which is not localized

Expected behavior top date should '2020年 7月.

Screenshots If applicable, add screenshots to help explain your problem. image

** workaround ** use dateFormatCalendar="yyyy年 LLLL" for 'ja' locale only it shows: image

however I expect react-datepicker to convert 'LLLL yyyy' default value to the right one in current locale.

Desktop (please complete the following information):

  • Browser Chrome Version 83.0.4103.116 in Win10

arnauddem avatar Jul 16 '20 14:07 arnauddem