Skip to content

Commit

Permalink
Merge pull request #763 from Conflux-Chain/s37
Browse files Browse the repository at this point in the history
fix: fixed dayjs locale issue in chart preview page
  • Loading branch information
0x74616e67 authored May 27, 2022
2 parents fa5eefd + 5b6d49b commit 99841c0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/app/containers/Charts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PageHeader } from 'app/components/PageHeader/Loadable';
import { useTranslation } from 'react-i18next';
import { translations } from 'locales/i18n';
import styled from 'styled-components/macro';
import dayjs from 'dayjs';
import moment from 'moment';

import { BlockTime } from './BlockTime';
import { TPS } from './TPS';
Expand All @@ -25,14 +25,9 @@ export function NewChart() {
const iszh = i18n.language.includes('zh');

const format = iszh ? 'YYYY MMMDD' : 'DD MMM YYYY';
const current = dayjs().subtract(1, 'day');
const current = moment().subtract(1, 'day');
const oneMonthBefore = current.subtract(30, 'day');

if (localStorage.getItem('test')) {
console.log(iszh, format);
console.log(oneMonthBefore.format(format), current.format(format));
}

return (
<StyledChartPreviewWrapper>
<PageHeader subtitle={t(translations.highcharts.preview.subtitle)}>
Expand Down

0 comments on commit 99841c0

Please sign in to comment.