React-datepicker: date-fns does not currently support locale 'ko'

Created on 20 Dec 2018  路  3Comments  路  Source: Hacker0x01/react-datepicker

Expected behavior

<Datepicker locale='ko' />

It should work fine when apply the 'ko' locale through the date-fns@next version.

Actual behavior

An error occurs.

Error: ko locale is currently unavailable. Please check the progress of converting this locale to v2.0.0 in this issue on Github: TBA

There seems to be many locale packages not supported by the date-fns 2.0 alpha version.

Steps to reproduce

  1. Install date-fns@next

  2. Apply locale configuration.

import Datepicker, { registerLocale } from 'react-datepicker';
import ko from 'date-fns/locale/ko';
registerLocale('ko', ko);

...

render() {
  return <Datepicker locale='ko' />
}
  1. An error occurs.
Error: ko locale is currently unavailable. Please check the progress of converting this locale to v2.0.0 in this issue on Github: TBA
wontfix

Most helpful comment

+1, any workaround for this? Is there any way to set months/days strings manually? Component's sweet itself, but for my usecase it's useless without proper locale.

All 3 comments

+1, any workaround for this? Is there any way to set months/days strings manually? Component's sweet itself, but for my usecase it's useless without proper locale.

Seems that this is an issue that should be logged against date-fns, rather than react-datepicker?
As things stand date-fns v2.x does not yet support Korean - ko is listed in https://github.com/date-fns/date-fns/blob/master/outdatedLocales.json.
Adding support to date-fns for a particular locale is described here:
https://date-fns.org/v2.0.0-alpha.27/docs/I18n#adding-new-language

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings