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.

dateFnsLocalizer is not working

See original GitHub issue
const locales = {
  'zh-TW': require('date-fns/locale/zh-TW'),
}

my package.json

"date-fns": "^2.15.0",
"react-big-calendar": "^0.26.0",
"typescript": "~3.7.2"

It always show en-US in calendar. It that bug?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:7

github_iconTop GitHub Comments

11reactions
efflamcommented, Sep 10, 2020

@pig800509 You should pass culture={"zh-TW"} as a prop to <Calendar/>

10reactions
MrBlue9commented, Sep 25, 2020

Try importing the locale object via namespace import

import { zhTW } from 'date-fns/locale'

and then using it like this:

const locales = {
  'zh-TW': zhTW
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

react-big-calendar doesn't show events
The problem is, they're not loading at all. ... useState } from 'react'; import { Calendar, dateFnsLocalizer } from 'react-big-calendar'; ...
Read more >
Input I18n | React Widgets
The date-fns localizer is a convenient option to get up and running quickly as it is ready-to-use with the en-US locale without any...
Read more >
react-big-calendar
Start using react-big-calendar in your project by running `npm i react-big-calendar`. There are 218 other projects in the npm registry using ...
Read more >
Add a Calendar to a React App with react-big-calendar
The localizer determines how dates are formatted. With both examples, we should see a calendar with some events displayed. format is a function...
Read more >
react-big-calendar
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js. DashboardCtrl+Escape ...
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