react-widgets icon indicating copy to clipboard operation
react-widgets copied to clipboard

DateFnsLocalizer not working in v5

Open mlarcher opened this issue 4 years ago • 1 comments

According to the doc, the signature is

const localizer = new DateFnsLocalizer({
  formats,
  locales,
});

while since v5 DateFnsLocalizer only accepts locale as a single parameter, as can be seen in https://github.com/jquense/react-widgets/blob/master/packages/localizer-date-fns/localizer.ts#L14

On a more global point of view, docs are really unclear and lacking details about <Localization> and how to handle the Localizers / what they actually do

mlarcher avatar May 05 '21 10:05 mlarcher

also, There is a format issue with date-fns that requires using formatOverrides (or so it seems) but I see no doc about it either. cf screenshot for the actual error

Capture d’écran 2021-05-05 à 12 49 30

Looks like this is originating there https://github.com/jquense/react-widgets/blob/debfb8ff124b5afe83c79f874f71097c1f69772a/packages/localizer-date-fns/localizer.ts#L46 and causes a problem according to date-fns implementation described there https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md

mlarcher avatar May 05 '21 10:05 mlarcher