import dayjs from 'dayjs' const locale = { name: 'hu', weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'), months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'), monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'), ordinal: n => `${n}.`, relativeTime: { future: '%s múlva', past: '%s', s: 'néhány másodperc', m: 'egy perc', mm: '%d perc', h: 'egy óra', hh: '%d óra', d: 'egy nap', dd: '%d nap', M: 'egy hónap', MM: '%d hónap', y: 'egy éve', yy: '%d év' } } dayjs.locale(locale, null, true) export default locale
import React, { Component } from 'react' import { withRouter } from 'react-router-dom' import { Layout, Menu, Icon } from 'antd' import day from 'dayjs' import dayLocale from 'dayjs/locale/zh-cn' import MainRouter from '../../routers/mainRouter/' import mainRouterConfig from '../../routers/mainRouter/config' import './index.scss' day.locale('zh-cn', dayLocale) const {Header, Sider, Content} = Layout const filterPath = (path) => { let obj = mainRouterConfig.filter(v => { return v.route.path === path }) return obj.length > 0 ? obj[0] : null } class Main extends Component { constructor (props) { super(props) let location = this.props.location let current = filterPath(location.pathname)