G
G
godsplane2019-12-16 15:24:22
JavaScript
godsplane, 2019-12-16 15:24:22

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>
}

I will be glad for any hints.
Specifically, I don't understand what event.summary is, because I think that's where the values ​​come from.
The site itself: https://www.conceptfitness.ru/ (If it helps somehow)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
godsplane, 2019-12-16
@godsplane

Issue resolved, data taken from google calendar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question