change config file structure
This commit is contained in:
@@ -8,11 +8,16 @@ const TimeLineDetails = () => {
|
||||
const {config} = useConfig()
|
||||
const [timeLineList, setTimeLineList] = useState([])
|
||||
|
||||
const deadlines = Object.keys(config.deadlines).map(key => ({
|
||||
type: key,
|
||||
...config.deadlines[key]
|
||||
}));
|
||||
|
||||
useEffect(() => {
|
||||
let tempArr = []
|
||||
for (const timeLine of config.time_lines.navgan_first_page) {
|
||||
for (const timeLine of deadlines) {
|
||||
let temp = {}
|
||||
temp['label'] = timeLine.label
|
||||
temp['label'] = timeLine.timeline_label
|
||||
temp['date'] = moment(timeLine.date.from, 'jYYYY/jMM/jDD').locale('fa').format('jD jMMMM')
|
||||
const fromDate = moment(timeLine.date.from, 'jYYYY/jMM/jDD')
|
||||
const toDate = moment(timeLine.date.to, 'jYYYY/jMM/jDD')
|
||||
|
||||
Reference in New Issue
Block a user