0

I am using "react-big-calendar": "^0.20.3",

Currently i am using getDrilldownView={(targetDate, currentViewName, configuredViewNames) => this.updateDate(targetDate, currentViewName, configuredViewNames)}props on component to get start and end time in big calendar react js. I feel like this is not good way to get start and end date and i could not find it on documentation too.

https://codesandbox.io/s/vw3wlm63y

what i want is 2019/1/27 as start date and 2019/3/2 as end date

and onRangeChange gives both start and end date when view or date is changed but i want it when the page loads

ujwal dhakal
  • 2,289
  • 2
  • 30
  • 50

2 Answers2

0

I am using

this.startDate = moment().subtract(1, 'months').endOf('month').startOf('week').format('YYYY/MM/DD');
        this.endDate = moment().add(1, 'months').startOf('month').endOf('week').format('YYYY/MM/DD');

and it worked to get the start and end date of current calendar view for first load. I think there is not inbuilt method to get details.

ujwal dhakal
  • 2,289
  • 2
  • 30
  • 50
0

I got the same problem with react-big-calendar and I solved it with:

const start = moment().startOf('month').startOf('week').format('YYYY/MM/DD');
const end = moment().endOf('month').endOf('week').format('YYYY/MM/DD');
maustruy
  • 1
  • 1
  • 2