clauderic / react-infinite-calendar

✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.

Home Page:http://clauderic.github.io/react-infinite-calendar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does calendar withRange support localization?

abbudao opened this issue · comments

I'm trying to translate my calendar but the header information is not getting translated at all.
Your localization example works fine without Component={CalendarWithRange} though.
Minimal (not working) example:

<InfiniteCalendar
  locale={{
    locale: require('date-fns/locale/fr'),
    headerFormat: 'dddd, D MMM',
    weekdays: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'],
    blank: 'Aucune date selectionnee',
    todayLabel: {
      long: 'Aujourd\'hui',
      short: 'Auj.',
    },
  }}
  selected={{
    start: new Date(),
    end: new Date(),
  }}
  Component={CalendarWithRange}
/>

Am I missing something? Should the localization be done elsewhere?
(Ps: Thank you for your awesome work )

same issue here... Did you fix it?

I fixed it...
It was not the problem of this project, but because of my project...
By using debugging tools, I figured out that the date-fns/format didn't work as it should do. And I had both v2.0.0 alpha 7 date-fns (for my use) and v1.29.0 date-fns (under this project node_modules).

I switch v2.0.0 to v1.29.0 and re-install modules to fix the problem and now it works fine as it should be.

if you still had same issue or any other does, i recommend you to re-install npm modules and check your projects.

Respect this awesome work