Answer the question
In order to leave comments, you need to log in
How to understand where the time value in the schedule comes from?
The task is to swap coaches, I tried to understand by what principle they are tied to one time or another, but I could not understand, so I ask for help.
The code, as I understand it, also takes these values from somewhere.
const oneTimeEvent = (event, desc) => {
const obj = {
start: event.start.dateTime,
title: event.summary,
id: event.id,
desc: desc,
startX: moment(event.start.dateTime).format('MM/DD/YYYY').toString()
}
listEvents = [...listEvents, obj]
}
const intervalEvent = (event, desc) => {
let events = []
for (let i = 0; i < 39; i++) {
const obj = {
start: moment(event.start.dateTime).add(7 * i, 'day').format().toString(),
title: event.summary,
id: event.id,
desc: desc,
startX: moment(event.start.dateTime).add(7 * i, 'day').format('MM/DD/YYYY').toString()
}
listEvents = [...listEvents, obj]
}
}
return <div className="cal">
{
hours.map(h => {
return <div className="row" key={h}>
<div className="hour">{h}:00</div>
<div className="cal_lessons">
<div className="lesson_mob_scroll">
{
findEvents.map(e => {
if (h.toString() === moment(e.start).format('HH').toString()) {
return <div className="cal_one_lesson" key={Math.random()}>
<Link key={Math.random()} to={{
pathname: '/order',
state: {
param: 'Button: ' + e.title +' '+e.desc,
formTitle: 'Запись на '+e.title,
info: 'Time: '+e.start
}
}}>
<div className="lessonText">
<div className="l_title">{e.title}</div>
<div className="l_desc">{e.desc}</div>
</div>
</Link>
<div className="red_bar"></div>
</div>
}
})
}
</div>
</div>
</div>
})
}
</div>
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question