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.

Datepicker calendar is showing Chinese

See original GitHub issue

Datepicker showing Chinese by default instead of English. I have require and set moment.locale('en') to no avail.

Please help. thanks

发生问题的环境是:

  • antd 版本:
  • 操作系统及其版本:
  • 浏览器及其版本:

您做了什么?请提供尽可能详细的重现步骤。

您期待的结果是:

实际上的结果是:

可重现的在线演示

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

22reactions
anjikinnaracommented, Dec 22, 2016

Localeprovider takes a context. Can you try wrapping your redux provider in Localeprovider and let me know. The following worked for me

ReactDOM.render(
  <LocaleProvider locale={enUS}>
  <Router history={browserHistory}>
    <Route path="/" component={App}   >
          ..,,
   </Route>
   <Route path="/login" component={Login} />
 </Router>
  </LocaleProvider>,
  document.getElementById('root') )

Thanks

1reaction
enzolutionscommented, Apr 21, 2017

@benjycui I solved my issues in meteor after install https://github.com/ant-design/babel-plugin-import

create a .babelrc with the following content

{
  "plugins": [
    ["import", { "libraryName": "antd", "style": true }]
  ]
}

My code looks like

import 'antd/lib/locale-provider/style';

import locales from 'antd/lib/locale-provider/en_US';

<LocaleProvider locale={locales}>
  <Popconfirm title="Sure to delete?" onConfirm={() => this.onDelete(text,record, index)}>
    <a href="#">Delete</a>
  </Popconfirm>
</LocaleProvider>

Now all my components are rendering the proper language.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datepicker is showing Days & month names in chinese, how ...
I am trying to use date picker, the output is as show in below. element-ui-datepicker. here bit weird thing i observed related to...
Read more >
jquery - Datepicker is always displayed in Simplified Chinese?
i'm trying to get the JQueryUI datepicker to display French/English localisations, but only Simplified Chinese is being displayed.
Read more >
iOS15 UIDatePicker shows strange year - Apple Developer
Chinese calendar UIDatepicker the year of 2021 will become 38, how to change it back to 2021 in UIDatepicker. datePicker.
Read more >
jQuery Datepicker Showing Chinese Characters
for some reason my jQuery datepicker was showing Chinese characters. here's the fix: <script type="text/javascript"> $(function() ...
Read more >
2927372 - SAPUI5: DatePicker and Calendar controls do not ...
When logged in with Chinese, Japanese or Traditional Chinese language, SAPUI5 controls ... DatePicker do not show the month above calendar, only the...
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