Material-table: date filter: picker language customizable

Created on 1 May 2019  路  6Comments  路  Source: mbrn/material-table

Is your feature request related to a problem? Please describe.
Actually, if i filter a row of the type date, the datepicker is always in english. For my webapp and german clients isn't that cool.

Describe the solution you'd like
I need to define in some way the date picker language. Maybe this way:
options={ { datePickerLocale: require('@date-io/date-fns/locale/de') } }

Describe alternatives you've considered
As an alternative, i see that material-table could handle it byself. Read navigator.language and then load the associated locale file from date-fns.

Additional context
Add any other context or screenshots about the feature request here.

enhancement

Most helpful comment

unfortunately. I will take a look at it asap.

All 6 comments

Any updates on this matter?
The only missing localization is the datepicker.

unfortunately. I will take a look at it asap.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

Still current! /reopen

meanwhile I did the override of the filter row and changed the dateTimePickerLocalization prop

import it from "date-fns/locale/it";

//...
        <MaterialTable
          //...
          components={{
            FilterRow: (props) => {
              return (
                <MTableFilterRow
                  {...props}
                  localization={{
                    dateTimePickerLocalization: it,
                  }}
                />
              );
            },
          }}
        />

Hi,

@iltumio , your solution is good for the format of the date.
But how I can change also the language of the buttons ?

Was this page helpful?
0 / 5 - 0 ratings