From 29b8d9f667a1e2597fba138213eb0c53e1c34ed4 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 16 Feb 2021 10:18:58 -0800 Subject: [PATCH] Configure momentum i18n. --- .../components/maps-page/maps-list/index.tsx | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/webapp/src/components/maps-page/maps-list/index.tsx b/packages/webapp/src/components/maps-page/maps-list/index.tsx index c09697c7..982a9075 100644 --- a/packages/webapp/src/components/maps-page/maps-list/index.tsx +++ b/packages/webapp/src/components/maps-page/maps-list/index.tsx @@ -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(a: T, b: T, orderBy: keyof T) { if (b[orderBy] < a[orderBy]) { @@ -209,7 +206,12 @@ export const MapsList = (props: MapsListProps) => { const intl = useIntl(); const queryClient = useQueryClient(); - + + // Configure locale ... + const account = fetchAccount(); + if (account) { + moment.locale(account.locale.code); + } useEffect(() => { setSelected([]);