get appointments today.

Is it possible to pick up all of today's appointments automatically, including recurring ones?
Is it possible for a Calendar Controller Listener to return an onTapDetails? I really need it.

16 Replies 1 reply marked as answer

IR Indumathi Ravichandran Syncfusion Team June 23, 2020 05:34 AM UTC

Hi Vagner, 
 
Thank you for contacting Syncfusion support. 
  
Query 1: 
 
Based on the provided information your requirement “Getting current day appointments automatically” and it can be achieved by using selectedDate property of calendar controller. Also, we have a KB document for the same. 
 
Please find the KB document from the following link, 
 
 
Also, we have prepared the simple sample for the same with recurrence appointment. Please find the sample from the following link, 
  
 
  
Query 2: 
Based on the provided information, your requirement is “Getting the tap details of calendar”. Based on the calendar targetElement of the onTap callback, you can get the tapped details of the Flutter calendar such as   header, view header, calendar cell, appointments. Please find the KB links for the same. 
 
  
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R 


Marked as answer

VW Vagner Willian Martin Ferreira June 23, 2020 05:48 AM UTC

Thanks,

i resolved problem lonely.

Thanks, thanks, thanks


IR Indumathi Ravichandran Syncfusion Team June 23, 2020 06:28 AM UTC

Hi Vagner, 
 
Thank you for the update. 
 
We are glad to know that the issue resolved at your end. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Indumathi R 



VW Vagner Willian Martin Ferreira June 24, 2020 08:36 AM UTC

This solution does not return appointments recurring forever and dates in the interval between the start date and the end date. The idea is whenever there are appointments on the selected date, list them for me.

I need viewChanged to return the same appoints that CalendarTapDetails.appoints would return;

In short, when loading the calendar, I need to return all of today's appointments.

Help me, please!


IR Indumathi Ravichandran Syncfusion Team June 24, 2020 11:09 AM UTC

Hi Vagner, 
 
Thank you for the update. 
 
Regarding Query 1: 
 
We have checked with below recurrence rule with end date and without end date, it returns the recurrence appointment properly with the mentioned recurrence rule. Please find the following recurrence. 
 
recurrenceRule: 'FREQ=DAILY;INTERVAL=1;UNTIL=20200827T183000Z'
recurrenceRule: 'FREQ=DAILY;INTERVAL=1'
 
 
Regarding Query 2 & 3: 

We have modified the provided sample for showing current day appointments initially and show the selected appointments while selecting a date. Please find the sample from the following link. 
 
Code snippet: 
void viewChanged(ViewChangedDetails viewChangedDetails) {
  SchedulerBinding.
instance.addPostFrameCallback((duration) {
   
var midDate = (viewChangedDetails
        .
visibleDates[viewChangedDetails.visibleDates.length ~/ 2]);
   
if (midDate.month == DateTime
       
.now()
        .
month)
     
_calendarController.selectedDate = DateTime.now();
  });
}
 
 
 
Video link: 
 
We hope that this helps you, if the sample doesn’t meet your requirement kindly revert us with more details, which help us to analyze and resolve your requirement. 
 
Regards, 
Indumathi R 



VW Vagner Willian Martin Ferreira June 25, 2020 12:45 AM UTC

When displaying the calendar, it selects the date, however, it does not update the list of appoints when this appoint has an end date greater than the start date.

https://imgur.com/M2fjfb6
In this his example, after opened screen, he select today date, however, not show the appoints in bottom.




IR Indumathi Ravichandran Syncfusion Team June 25, 2020 07:36 AM UTC

Hi Vagner, 
 
Thank you for the update. 
 
Based on the provided information, we have checked “Appointments not updated in custom agenda view with an end date greater than the start date” and we are unable to replicate the issue and it is working fine as expected from our end. We have prepared the simple sample for the same. Please find the sample from the following link. 
 
Tested scenarios: 
·       Set the appointment start time is greater than the end time and checked (With and without custom agenda view). 
·       Set the appointment end time is greater than the start time and checked (With and without custom agenda view). 
·       Tested with the recurrence rule. 
 
Code snippet: 
appointments.add(Appointment(
  startTime:
DateTime(2020,6,25,10,0,0),
  endTime:
DateTime(2020,6,25,9,0,0),
  subject:
'Meeting',
  color: Colors.
red,
    recurrenceRule:
'FREQ=DAILY;INTERVAL=1;UNTIL=20200827T183000Z'
)); 
/// 
appointments.add(Appointment(
  startTime:
DateTime(2020,6,25,9,0,0),
  endTime:
DateTime(2020,6,25,11,0,0),
  subject:
'Meeting',
  color: Colors.
red,
    recurrenceRule:
'FREQ=DAILY;INTERVAL=1;UNTIL=20200827T183000Z'
)); 
 
 
 
 
 
If possible, can you please replicate the issue in the attached sample, otherwise we would like to set up a web meeting to reproduce the issue at your end. Would you please get back to us on your availability for a web meeting?   
 
Regards, 
Indumathi R 



VW Vagner Willian Martin Ferreira July 2, 2020 05:33 AM UTC

• are you using the same day ont he start and end date. Using a end date. use the end date greater than the start date and test. the Calendar has multiply appointments. :(

• When the date initial != date final, onlye first day show a appointments. Im trying build an agenda custom.


IR Indumathi Ravichandran Syncfusion Team July 2, 2020 12:40 PM UTC

Hi Vagner, 
 
Thank you for the update. 
 
Based on the provided information, we have checked the mentioned issue “First day appointments only shown when end date is greater than the start date”. We have checked with custom agenda view with spanning appointment and it is working fine as expected. We have prepared the simple sample and video for the same. Please find the sample and video from the following links. 
 
Sample link: 
 
 
If possible, can you please share below details, 
 
·       Are you using any recurrence rule? 
·       Code snippet of the appointment 
 
If possible, can you please modify the sample based on your scenario and revert us back with the more details, it would be helpful for us to analyze and provide you a solution at the earliest. 
 
Regards, 
Indumathi R 



VW Vagner Willian Martin Ferreira July 2, 2020 06:39 PM UTC

Ok, i resolved this problema with date initial diference of the final date. But, now, the points recurrence don't show when initialize my custom agenda.

Help, please :(

Test this:
https://github.com/SyncfusionExamples/selected-date-events-custom-agenda-view-calendar-flutter/blob/master/lib/main.dart

replace this method in bottom, and test. The date has recurrence dont show on the initialization:
List<Appointment> getCalendarDataSource() {
List<Appointment> appointments = <Appointment>[];
appointments.add(Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(Duration(hours: 1)),
subject: 'Meeting',
color: Colors.green,
));
appointments.add(Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(Duration(hours: 2)),
subject: 'Planning',
color: Colors.red,
));
appointments.add(Appointment(
startTime: DateTime(2020, 5, 1, 9, 0, 0),
endTime: DateTime(2020, 5, 1, 10, 0, 0),
subject: 'Planning',
color: Colors.yellow,
));
appointments.add(Appointment(
startTime: DateTime.now().subtract(Duration(days: 1)),
endTime: DateTime.now().add(Duration(days: 3)),
subject: 'Recurrence',
color: Color(0xFFfb21f66),
recurrenceRule: 'FREQ=DAILY;INTERVAL=2;COUNT=10'));

return appointments;
}


VW Vagner Willian Martin Ferreira July 3, 2020 03:10 AM UTC

The proble is here:
are return only of the appointments in viewStartDate, but if the appointment its more the one day?

final List<DateTime> dateCollection =
SfCalendar.getRecurrenceDateTimeCollection(
appointment.recurrence_rule, appointment.date);
for (int j = 0; j < dateCollection.length; j++) {
if (_isSameDate(dateCollection[j], viewStartDate)) {
appointmentDetails.add(appointment);
}
}


IR Indumathi Ravichandran Syncfusion Team July 3, 2020 10:36 AM UTC

Hi Vagner, 
 
Thank you for the update. 
 
Based on the attached code snippet, we have checked your requirement “Recurrence appointment not shown initially with custom agenda view”. In the sample we have considered simple recurrence appointment and its start and end date as same so that we added the condition to check the date as equal. But in your sample that start date and end date not equal, so check the condition for selected date is in between the recurrence start and end date. Now we have modified the sample based on your requirement. Please find the sample from the following link. 
 
Sample link: 
 
We hope that this helps you. Please let us know if you need further assistance. 

Regards, 
Indumathi R 



VW Vagner Willian Martin Ferreira July 3, 2020 01:15 PM UTC

Yeeeah !! you are fuc**!!! Thank you forever!
Now, is necessary this work when dont contains ";COUNT", that is, appointment with recurrence forever .
Test this:
List<Appointment> getCalendarDataSource() {
List<Appointment> appointments = <Appointment>[];
appointments.add(Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(Duration(hours: 1)),
subject: 'Meeting',
color: Colors.green,
));
appointments.add(Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(Duration(hours: 2)),
subject: 'Planning',
color: Colors.red,
));
appointments.add(Appointment(
startTime: DateTime(2020, 5, 1, 9, 0, 0),
endTime: DateTime(2020, 5, 1, 10, 0, 0),
subject: 'Planning',
color: Colors.yellow,
));
appointments.add(Appointment(
startTime: DateTime.now().subtract(Duration(days: 1)),
endTime: DateTime.now().add(Duration(days: 3)),
subject: 'Recurrence',
color: Color(0xFFfb21f66),
recurrenceRule: 'FREQ=WEEKLY;BYDAY=TH'));

return appointments;
}


IR Indumathi Ravichandran Syncfusion Team July 6, 2020 09:33 AM UTC

Hi Vagner, 
 
Thank you for the update. 
 
In the Flutter calendar, you don’t provide any end date or count for recurrenceRule, so it returns the empty collection. You need to specify specificStartDate and specificEndDate args of the getRecurrenceDateTimeCollection method for getting the recurrence date time collection until the mentioned specified end date. We have prepared the simple sample for the same. Please find the sample from the following link. Please find the code snippet for the same.  
 
Code snippet: 
List<Appointment> getCalendarDataSource() {
  List<Appointment> appointments = <Appointment>[];
  appointments.add(
Appointment(
      startTime:
DateTime.now().subtract(Duration(days: 1)),
      endTime:
DateTime.now().add(Duration(days: 3)),
      subject:
'Recurrence',
      color:
Color(0xFFfb21f66),
      recurrenceRule:
'FREQ=WEEKLY;BYDAY=TH'));

 
return appointments;
}
 
final List<DateTime> dateCollection =
    SfCalendar.getRecurrenceDateTimeCollection(
        appointment.
recurrenceRule, appointment.startTime,
        specificStartDate: appointment.
startTime,
        specificEndDate:
DateTime(2020, 8, 6, 9, 0, 0)); 
 
 
Sample link: 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
 Indumathi R


VW Vagner Willian Martin Ferreira July 7, 2020 02:39 PM UTC

I can’t thank you enough for everything you’ve done.

Thanks !!


IR Indumathi Ravichandran Syncfusion Team July 8, 2020 05:34 AM UTC

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


Loader.
Up arrow icon