question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work locale 'ru' with showMonthYearPicker

See original GitHub issue

I set locale

import DatePicker, { registerLocale } from “react-datepicker”; import ru from “date-fns/locale/ru”;

componentWillMount() { registerLocale(“ru”, ru); }

and create datepicker <DatePicker selected={this.state.date} showMonthYearPicker dateFormat="YYYY-MM" locale="ru" />

Datepicker language is “en”

It didn’t work with showMonthYearPicker, but without showMonthYearPicker all is good

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
YevhenKysilovcommented, May 3, 2019

package.json "date-fns": "2.0.0-alpha.27",

component.js Not working: import ru from 'date-fns/locale/ru'; Working: import * as ru from 'date-fns/locale/ru';

<DatePicker locale={ru}/>

It doesn’t work with showMonthYearPicker

1reaction
golubvladimircommented, Apr 22, 2019

package.json

"date-fns": "^2.0.0-alpha.23",

component.js

import ru from 'date-fns/locale/ru';
...
<DatePicker
  locale={ru}
>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Month Picker from react-datepicker doesn't work
I'm using react-datepicker node module to pick month-year . But It is showing dates as well . I dont want to show date...
Read more >
Hacker0x01 - Bountysource
The disabled attribute does not seem to work for inline DatePickers. ... inline monthsShown={3} showYearDropdown locale={ru} disabledKeyboardNavigation ...
Read more >
Datepicker Mindate - OrganiCoal
Datepicker MindateInsert the following code into your project. Steps to create datepicker in Angular applications. maxDate = moment( [currentYear + 1, 8, ...
Read more >
https://customtape.app/api/v1/cpt-tool/site/bundle/4
updateLocale(localeName, config) to change an existing locale. moment. ... with v2.0.0-beta.1 date-fns doesn't accept strings as arguments.
Read more >
HackerOne react-datepicker Issues - Giters
Locale RU does not work since version 4. ... showMonthYearPicker - Disabled months from current year also got disabled after going to previous...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found