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

Locale is deafult on initialize

rafallyczkowski opened this issue · comments

I have weird issue, when rendering calendar I have default english langiage set even though I'm using

  locale={{
                                    locale: require('moment/locale/fr'),
                                  }}

attribute, but when rerendering it (going back step) language is good. Any advise about this ?

Any1 can help why initially locale is not being loaded?

Try this:

<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.' } }} />

@shivamgupta1996 the point is that I want to use i18n to translate for me, not making myself setting up specific strings... Do you know how can I extract formats from date-fns/locale ?

Tried .localize.weekdays({type: 'narrow'}), but no luck.

also how to access todayLabel object from date-fns?

Any advice on that one? Trying to initially set locale but no luck. Has anyone got this problem?

same problem here all done like on website but locales does not work

so i managed to make it work all i had to do is to downgrade the version of date-fns and all started to work

Hi all, good job guys what have you done is amazing, but this issue still exists.