Xamarin iOS SelectedDate Bug

Hello,

I'm working with SfCalendar and noticed what appears to be a bug with the SelectedDate property. When I open an appointment list for a date without closing it and select another date, this property gets updated with the correct selected date value. However, when I open a list, collapse it, THEN open another dates list, the value for the selected date property is still set to the previous date. I've replicated this bug on not only my project, but also a couple of solutions posted on earlier forms including the one attached.

Steps to replicate issue:

Step 1: Open June 22 2017

Step 2: Close June 22 2017

Step 3: Open June 11 2017, notice the appointment info from the previous date remains the same

Thank you in advance for your help.

Regards,
Andrew

Attachment: CalendarSample_2_3840835627163710234_b0e0c9b7.zip

3 Replies

VR Vigneshkumar Ramasamy Syncfusion Team October 4, 2018 06:50 AM UTC

Hi Andrew

Thank you for Contacting Syncfusion Support.

Based on the provided sample, we have checked your issue with “SelectedDate is not updated properly in SfCalendar on iOS”. As per the current implementation the OnInlineLoaded event will be raised before the SelectionChanged event which is an expected behavior of SfCalendar Xamarin. We have modified the sample to get TempCollection using Appointment`s Start Time (Not applicable for spanning appointments which is started and ends in different date), please find the modified sample from the below link.

Sample Linkhttp://www.syncfusion.com/downloads/support/forum/140196/ze/CalendarSample-530401984.zip

Code snippet to get SelectedDate Appointment details and Today Date Details:


 
 
void HandleSelectionEventHandler(object sender, SelectionChangedEventArgs args) 
            { 
                vm.Today = (sender as SfCalendar).SelectedDate.ToString("yy-MMM-dd ddd"); 
            } 
 
            void HandleDrawInlineEventHandler(object sender, InlineEventArgs args) 
            { 
                if (args.appointments == null || args.appointments.Count == 0) 
                    return; 
                // Not applicable For spanning appointments (Started From Different Date) 
                TempCollection = GetSelectedDateAppointments(args.appointments[0].StartTime); 
                if (vm.Collection != null) 
                { 
                    vm.Collection.Clear(); 
                } 
                for (int i = 0; i < TempCollection.Count; i++) 
                { 
                    vm.Collection.Add(new Model() { Subject = TempCollection[i].Subject, Start = TempCollection[i].StartTime.ToString("t"), End = TempCollection[i].EndTime.ToString("t"), Location = TempCollection[i].Location }); 
                } 
                CustomInlineView inlineView = new CustomInlineView(this) { BindingContext = vm }; 
                StackLayout stk = new StackLayout(); 
                stk.HeightRequest = 150; 
                stk.Children.Add(inlineView); 
                args.View = stk; 
            } 
 

If the given information doesn’t meet your requirement, could you please revert us with more information about your requirement in detail, it will be helpful for us to check on it and provide you the better solution. 

Regards,
Vigneshkumar R 



AJ Andrew Jabbour October 4, 2018 01:35 PM UTC

Hello,

Thank you for the quick response! I have implemented this logic into my project and have resolved this issue.

Sincerely,
Andrew


VR Vigneshkumar Ramasamy Syncfusion Team October 5, 2018 06:58 AM UTC

Hi Andrew 
 
We glad to know that your requirement has been achieved. Please get in touch if you required further assistance on this. 
   
Regards 
Vigneshkumar R 


Loader.
Up arrow icon