How to Configure 7-Day Navigation in Agenda View for React Schedule?
This article provides guidance on implementing functionality where clicking the Next button navigates 7 days forward and clicking the Previous button navigates 7 days backward in React Schedule Agenda view. To achieve this, you can leverage the navigating event in the Scheduler component. This event enables you to dynamically adjust the currentDate based on the selected date, offering precise control over the displayed date range.
const onNavigating = (args) => {
if (args.action === 'date') {
const currentDate = args.previousDate;
const newDate = new Date(currentDate);
if (args.currentDate > args.previousDate) {
newDate.setDate(currentDate.getDate() + agendaDaysCount);
} else {
newDate.setDate(currentDate.getDate() - agendaDaysCount);
}
args.currentDate = newDate;
}
};
return (
<div className='schedule-control-section'>
<div className='col-lg-9 control-section'>
<div className='control-wrapper'>
<ScheduleComponent
agendaDaysCount={agendaDaysCount}
navigating={onNavigating}
>
<Inject services={[Agenda]} />
</ScheduleComponent>
</div>
</div>
</div>
);Refer to the
working sample for additional details and implementation: Sample
Conclusion:
We hope you enjoyed learning on how to configure 7-Day navigation in agenda view for React Scheduler.
You can refer to our React Scheduler feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our React Scheduler Example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, BoldDesk Support, or feedback portal. We are always happy to assist you!