diff --git a/src/forge/users/GeneralView/Index.jsx b/src/forge/users/GeneralView/Index.jsx index 5cf06032..600b9739 100644 --- a/src/forge/users/GeneralView/Index.jsx +++ b/src/forge/users/GeneralView/Index.jsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import './Index.scss'; import 'echarts/lib/component/tooltip'; import 'echarts/lib/component/title'; @@ -12,13 +12,24 @@ import Line from '../Echart/Line'; import Calendar from '../Echart/Calendar'; import ConcentrateProject from './ConcentrateProject'; import Activity from './Activity'; +import moment from 'moment'; const aLimit = 5; function Index(props) { const [ page , setPage ] = useState(1); const [ total , setTotal ] = useState(0); + const [ createYear , setCreateYear ] = useState(undefined); + const username = props.match.params.username; const current_user = props.current_user; + const user = props.user; + + useEffect(()=>{ + if(user){ + let c = user.created_time && user.created_time.split("-")[0]; + setCreateYear(parseInt(c,0)); + } + },[user]) // 在贡献度日历表中选择一个时间 function chooseTime(data) { @@ -27,6 +38,12 @@ function Index(props) { } } + function renderYear(){ + let y = moment().get('year'); + for(var i = y ; i > createYear;i--){ + } + } + return(