We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Marking specific cycle of days.

Hello! I am not only new to Syncfusion and Xamarin Forms but to programming in general. 

I am looking to try to make a "work schedule" app. It is essentially just a regular display of a calendar with my rotating days off highlighted so can know at a glance when I am scheduled to be off. 

That being said my work week isn't weekends off! I know it would be easy with the weekends and weekdays, I saw those. I wish it was that simple. 

My work week is 5 work days, 2 days off, 5 more work days, and then 3 days off, rotating. Is there any way I can mark these days with something? (a border color, a background color, a symbol, etc)

The attached image is something exactly like what I want to do. 

Any advice is appreciated. The more detailed the better since I'm new. Thank you in advance. 


3 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team February 27, 2019 12:45 PM UTC

Hi Frank, 
 
Thank you for contacting Syncfusion support. 
 
We have analyzed your requirement of “Customizing the non-working days in SfCalendar” in Xamarin.Forms. As of now, SfCalendar doesn’t have the WorkWeekView support and you can achieve your requirement by using SfSchedule control. You can customize the Non-working days using on the NonWorkingDays property of WorkWeekViewSettings. Using this you can handle the required view based on week end days. 
 
We have prepared sample for the same, please find the sample by the following link. 
 
Sample link: Schedule 
 
Kindly refer our UG documentation for more information about customizing the WorkWeekView by the following link. 
 
 
We hope that this helps you, kindly revert us if you have any concern. 
 
Regards,
Subburaj Pandian V  



FR Frank March 5, 2019 09:24 PM UTC

I see how you did this with the "Work Week View" but I am looking to make it a "Month View" only. 

I don't know if this is doable in the Month View of SfSchedule either. Can you confirm this?

Check out the link I originally provided. I just want to reiterate that my work week is not consistent. I need to try to come up with a solution for my 5-2-5-3 work week. I want this to be implemented in the back-end while designing my application, not done by the user.


SP Subburaj Pandian Veluchamy Syncfusion Team March 6, 2019 09:25 AM UTC

Hi Frank, 
 
Thank you for the update. 
 
Your requirement of “Customizing the Month cell background color based on the dates” in Calendar Xamarin.Forms can be achieved using OnMonthCellLoaded event. Using this event, you can customize Text, Backgroud, Border color and Font by using MonthCellLoadedEventArgs argument. Earlier We have suggested SfSchedule control, since you have mentioned as WorkWeekView.  
 
Please refer the following code for your reference, 
 
[C#]
        calendar.OnMonthCellLoaded += Calendar_OnMonthCellLoaded;
 
         
        private void Calendar_OnMonthCellLoaded(object sender, MonthCellLoadedEventArgs args) 
        {  
                if (args.Date.Date == appointment.StartTime.Date) 
                { 
                    args.BackgroundColor = Color.blue; 
                } 
        } 
 
 
We have prepared sample based on your requirement, 
 
 
In the sample, we have set month cell Background color as LightSkyBlue for the appointment available days and set LightGreen for the some of the dates in the cells. We have set with random days, you can set by considering your week end days based on your requirement by comparing to the date of MonthCellLoadedEventArgs argument. 
 
We hope this helps. Please let us know if you have any query. 
 
Regards,
Subburaj Pandian V  


Loader.
Live Chat Icon For mobile
Up arrow icon