StephenChou1017 / react-big-scheduler

A scheduler and resource planning component built for React and made for modern browsers (IE10+)
https://stephenchou1017.github.io/scheduler/#/
MIT License
754 stars 414 forks source link

Question: how to get event length? #164

Closed madzadev closed 5 years ago

madzadev commented 5 years ago

event.start and event.end returns values in the following format: '2017-12-18 12:00:00'. is there a way to get the event length (in days for example), or should i do manual calculations between start and end dates?

madzadev commented 5 years ago

Got what I needed, using moment.js library:

const startDate = moment(moment(start).format('YYYY-MM-DD')); const endDate = moment(moment(end).format('YYYY-MM-DD'));

const lenght = endDate.diff(startDate, 'days')+1;