deseretdigital/dayzed

Offset -1 not working with getBackProps and getForwardProps

StKostyantin opened this issue · 1 comments

When you create a calendar in a range style. By default, it will show the current month and the next month.
But if you want to show the last month and the current month, you need to set offset-1

For example.

onst dayzedData = useDayzed({
    onDateSelected: handleOnDateSelected,
    selected: selectedDates,
    offset: -1,
    monthsToDisplay: 2,
    firstDayOfWeek: 1,
    date: new Date(),
    showOutsideDays: true,
  });

And it displays fine, but the onClick with getBackProps and getForwardProps stop working

When offset is passed as a prop it becomes controlled and will needed to be handled by you using the onOffsetChanged prop. Here are links to read more about it.

https://github.com/deseretdigital/dayzed#onoffsetchanged
https://github.com/deseretdigital/dayzed#control-props