Configure momentum i18n.

This commit is contained in:
Paulo Gustavo Veiga 2021-02-16 10:18:58 -08:00
parent 0fa1e20458
commit 29b8d9f667

View File

@ -1,5 +1,16 @@
import React, { useEffect, CSSProperties } from 'react';
import { useStyles } from './styled';
import { useSelector } from 'react-redux';
import { activeInstance, fetchAccount } from '../../../redux/clientSlice';
import { useMutation, useQuery, useQueryClient } from 'react-query';
import Client, { ErrorInfo, MapInfo } from '../../../classes/client';
import ActionChooser, { ActionType } from '../action-chooser';
import ActionDispatcher from '../action-dispatcher';
import moment from 'moment'
import { Filter, LabelFilter } from '..';
import { FormattedMessage, useIntl } from 'react-intl';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
@ -23,20 +34,6 @@ import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
import StarRateRoundedIcon from '@material-ui/icons/StarRateRounded';
import SearchIcon from '@material-ui/icons/Search';
import { useStyles } from './styled';
import { useSelector } from 'react-redux';
import { activeInstance } from '../../../redux/clientSlice';
import { useMutation, useQuery, useQueryClient } from 'react-query';
import { ErrorInfo, MapInfo } from '../../../classes/client';
import Client from '../../../classes/client';
import ActionChooser, { ActionType } from '../action-chooser';
import ActionDispatcher from '../action-dispatcher';
import moment from 'moment'
import { Filter, LabelFilter } from '..';
import { FormattedMessage, useIntl } from 'react-intl';
function descendingComparator<T>(a: T, b: T, orderBy: keyof T) {
if (b[orderBy] < a[orderBy]) {
@ -210,6 +207,11 @@ export const MapsList = (props: MapsListProps) => {
const queryClient = useQueryClient();
// Configure locale ...
const account = fetchAccount();
if (account) {
moment.locale(account.locale.code);
}
useEffect(() => {
setSelected([]);