Hide agenda view date?

Is it possible to hide the date that shows up next to the agenda list? 

Screenshot: https://share.getcloudapp.com/kpuLynoL

9 Replies

IR Indumathi Ravichandran Syncfusion Team April 20, 2020 09:04 AM UTC

Hi James, 
 
Thank you for contacting Syncfusion support. 
 
In the Flutter event calendar, we don’t have support for hiding the date on the agenda view. This requirement can be achieved using adding custom agenda view to event calendar. We have a KB document for providing custom agenda view using `OnTap` event. Please find the KB from the following link. 
 
KB link for agenda view customization, 
 
 
Also please find the following UG link agenda view customization, 
 
UG link: 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R 



JA James April 21, 2020 05:30 PM UTC

Thank you!


IR Indumathi Ravichandran Syncfusion Team April 22, 2020 04:58 AM UTC

Hi James, 
 
Thank you for the update. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Indumathi R 



JA James April 23, 2020 06:31 PM UTC

What's the best way to trigger the selection of a date when the calendar loads when using a custom agenda view?

Currently, when my calendar loads, I have to click the day in order to trigger the appointments to be shown. I could use `onViewChanged` but it returns a list of visible dates and not the actual appointments associated with those dates...


IR Indumathi Ravichandran Syncfusion Team April 24, 2020 06:49 AM UTC

Hi James, 
 
Thank you for the update. 
 
Regarding Query1: 
Using the `initialSelectedDate` property of the calendar you can set the initial selected for the calendar. Please find the following UG link for the same. 
 
 
Also using `onViewChanged` callback, you set the selected date for calendar using `selectedDate` property of `CalendarController`. Please find the following link for the same. 
 
 
Regarding Query 2: 
You can get the selected date appointment using `onTap` callback of the flutter calendar. Please find the following UG link for the same. Please find the code snippet. 
 
Code snippet: 
CalendarController calendarController= CalendarController(); 
void viewChanged(ViewChangedDetails viewChangedDetails) {
  SchedulerBinding.
instance.addPostFrameCallback((duration) {
   
calendarController.selectedDate = DateTime.now();
  });
}
 
 
UG link: 
 
By setting the selectedDate through the `onViewChanged` callback, you can get appointments on the selected date. 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R 



JA James April 26, 2020 05:49 PM UTC

Hi Indumathi,

Thanks for the reply. 

Unfortunately, I don't see a way that this works easily.

When using a custom agenda view, it was recommended to do the following:

Expanded(
  child: SfCalendar(
    view: _calendarView,
    dataSource: getCalendarDataSource(),
    onTap: calendarTapped,
  ),
),
void calendarTapped(CalendarTapDetails calendarTapDetails) {
  if (calendarTapDetails.targetElement == CalendarElement.calendarCell) { 
    setState(() {
      appointmentDetails = calendarTapDetails.appointments;
    });
  }
}

This works fine because `CalendarTapDetails` contains the actually appointments that are part of the day that was tapped.

However, with your suggestion of setting the selected date using `onViewChanged`, it does not return the appointments within the view, only the dates. Therefore, it would be up to the user to group their appointments by date and determine which ones fall on the current date and then set `appointmentDetails` to those dates. This is a lot of extra work for something that should be trivial.

I mentioned this in another thread, but this is where an `onInit` function, that runs only once, would be helpful. If this `onInit` function passed back an object that contained something like the following:

1. Visible dates (as done in the `onViewChanged` callback
2. Selected date, which contained the appointments associated with that date

I could then use #2 to set `appointmentDetails` immediately and therefore display the appointments in my custom agenda view without having to do a ton of manual work.

I think giving us more options to hook into the calendar's lifecycle would reduce the need for many of the workarounds.

Thank you.


IR Indumathi Ravichandran Syncfusion Team April 27, 2020 12:42 PM UTC

Hi James, 
 
Thank you for the update. 
 
Currently we are analyzing your requirement, we will validate and update further details on or before April 29,2020. We appreciate your patience until then. 
 
Regards, 
Indumathi R  



JA James April 29, 2020 02:12 AM UTC

Thank you, Indumathi! I appreciate the quick replies. Cheers.


IR Indumathi Ravichandran Syncfusion Team April 29, 2020 01:39 PM UTC

Hi James, 
 
Thank you for your patience. 
 
We will consider your requirement of “Getting appointments from the start and end date” as a feature and we have logged the feature request for the same. We will implement this feature in any of our upcoming releases. We appreciate your patience until then.  
 
You can track the current status of this report by the following link, 
 
 
Now, we have provided the workaround for updating the custom agenda view while selectedDate changed using the datasource of the Flutter calendar. Please find the sample from the following link. 
 
 
We hope that this helps you. Please let us know if you need further assistance on this. 
 
Regards, 
Indumathi R 


Loader.
Up arrow icon