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.
Unfortunately, activation email could not send to your email. Please try again.

Workweekview ios + how to bind multiple days to the NoneWorkingDays property

Thread ID:

Created:

Updated:

Platform:

Replies:

126133 Sep 26,2016 11:33 AM Sep 29,2016 06:38 AM Xamarin.Forms 6
loading
Tags: SfSchedule
Luuk
Asked On September 26, 2016 11:33 AM

Hey all,

I am currently using the syncfusion scheduler and it does seem to fit our needs. But on iOS it does display sat and sunday which it isn't supposed to do. I seem to have fixed this by just setting the NoneWorkingDays property, but I want to set both day "1" and day "6" (saturday and sunday).

This is the XAML I got right now that removes saturday. 

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:schedule="clr-namespace:Syncfusion.SfSchedule.XForms;assembly=Syncfusion.SfSchedule.XForms"
             x:Class="BNApp.Views.HomeScreenDetailWorkWeek" 
             Title="Business Navigator"  >
  <schedule:SfSchedule x:Name="Schedule"
                       ScheduleView="WorkWeekView"
                       Locale="nl-NL"
                       EnableNavigation="True"
                       BackgroundColor="White" FirstDayOfWeek="2" >
    <schedule:SfSchedule.WorkWeekViewSettings >
      <schedule:WorkWeekViewSettings NonWorkingsDays="6">      <---(help)
        <schedule:WorkWeekViewSettings.WorkWeekLabelSettings  >
          <schedule:WorkWeekLabelSettings TimeFormat="HH:mm" />
        </schedule:WorkWeekViewSettings.WorkWeekLabelSettings>
      </schedule:WorkWeekViewSettings>
    </schedule:SfSchedule.WorkWeekViewSettings>
  </schedule:SfSchedule>
</ContentPage>



This component does seem to work correctly on Android when displayed in WorkWeekview, but on iOS this workaround is needed.

Luuk
Replied On September 27, 2016 06:28 AM

UPDATE

To elaborate on the issue:

The issue is fixed when I don't set the TimeFormat of the WorkWeekView.. This seem to be a bug and really strange behavior. I do need the 24 hour notation, so I hope this bug will be adressed and fixed asap



Luuk
Replied On September 27, 2016 06:29 AM

<Grid x:Name="grid_layout">

    <schedule:SfSchedule
      x:Name="Schedule" ScheduleView="WorkWeekView"
      HorizontalOptions="FillAndExpand"
      VerticalOptions="FillAndExpand"
      Locale="nl-NL">


(This part breaks the schedule workview )
<!--<schedule:SfSchedule.WorkWeekViewSettings>
        <schedule:WorkWeekViewSettings >
          <schedule:WorkWeekViewSettings.WorkWeekLabelSettings>
            <schedule:WorkWeekLabelSettings TimeFormat="HH:mm"></schedule:WorkWeekLabelSettings>
          </schedule:WorkWeekViewSettings.WorkWeekLabelSettings>
        </schedule:WorkWeekViewSettings>
      </schedule:SfSchedule.WorkWeekViewSettings>-->

    </schedule:SfSchedule>

Swathi Gopal [Syncfusion]
Replied On September 27, 2016 08:09 AM

Hi Luuk, 
 
Thanks for your interest in Syncfusion products. 
 
We would like to let you know that we are able to reproduce the issue in the mentioned scenario and currently we are analyzing on your requirement, we will update you the details within two business days (Sep 29, 2016). We appreciate your patience until then.

 
As a workaround for the above mentioned issue you have used NonWorkingDays property of Schedule, where your requirement can be achieved by using the below code  
 
[c#] 
 
ObservableCollection<System.DayOfWeek> NonWorkingDays = new ObservableCollection<System.DayOfWeek>();      
 
            NonWorkingDays.Add(System.DayOfWeek.Saturday);
            NonWorkingDays.Add(System.DayOfWeek.Sunday);

            WorkWeekViewSettings workWeekViewSettings = new WorkWeekViewSettings();
            WorkWeekLabelSettings workWeekLabelSettings = new WorkWeekLabelSettings();
            workWeekLabelSettings.TimeFormat = "HH:mm";
            workWeekViewSettings.NonWorkingsDays = NonWorkingDays;
            workWeekViewSettings.WorkWeekLabelSettings = workWeekLabelSettings;
            Schedule.WorkWeekViewSettings = workWeekViewSettings;
                                 
  
 
Please let us know, if you have any concerns.  

Regards, 
Swathi G 


Luuk
Replied On September 27, 2016 08:44 AM

Hey,

Thank you for the quick reply, I am happy that it's indeed a bug and not something I did wrong.


I did find a workaround by writing in the code behind:

[c#] 

  if (Device.OS == TargetPlatform.iOS)
            {
                Schedule.WorkWeekViewSettings.NonWorkingsDays.Add(DayOfWeek.Saturday);
                Schedule.WorkWeekViewSettings.NonWorkingsDays.Add(DayOfWeek.Sunday);
            }



Also the following XAML seem to work:

[XAML]
<schedule:WorkWeekViewSettings.NonWorkingsDays>
        <x:DayOfWeek>
            <OnPlatform x:TypeArguments="x:DayOfWeek" iOS="Sunday">
            </OnPlatform>
           </x:DayOfWeek>
          <x:DayOfWeek>
            <OnPlatform x:TypeArguments="x:DayOfWeek" iOS="Saturday">
            </OnPlatform>
          </x:DayOfWeek>

</schedule:WorkWeekViewSettings.NonWorkingsDays>


The XAML above will be a workaround that only works for iOS, since Android somehow will remove both friday and thursday when applied... Even though I am using the Onplatform with only iOS.

Luuk
Replied On September 27, 2016 08:46 AM

Android in general does not seem to like using the enum names like friday etc. It does work when using the flags given to it for example monday = 1 so you write 1 instead of monday.

Subburaj Pandian Veluchamy [Syncfusion]
Replied On September 29, 2016 06:38 AM

Hi Luuk,

We are happy that provided workaround has resolved the mentioned issue. We have created a new support incident under your account to track the status of this issue. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know, if you have any query.

Regards,
Subburaj Pandian V.



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;