Configure momentum i18n.

This commit is contained in:
Paulo Gustavo Veiga 2021-02-16 10:18:58 -08:00
parent ef63782a57
commit 1972969298

View File

@ -1,5 +1,16 @@
import React, { useEffect, CSSProperties } from 'react'; 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 Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody'; import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell'; 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 StarRateRoundedIcon from '@material-ui/icons/StarRateRounded';
import SearchIcon from '@material-ui/icons/Search'; 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) { function descendingComparator<T>(a: T, b: T, orderBy: keyof T) {
if (b[orderBy] < a[orderBy]) { if (b[orderBy] < a[orderBy]) {
@ -209,7 +206,12 @@ export const MapsList = (props: MapsListProps) => {
const intl = useIntl(); const intl = useIntl();
const queryClient = useQueryClient(); const queryClient = useQueryClient();
// Configure locale ...
const account = fetchAccount();
if (account) {
moment.locale(account.locale.code);
}
useEffect(() => { useEffect(() => {
setSelected([]); setSelected([]);