Hi, I attach here an image with my problem.
Basically the month is cutted in android (in iOS it works perfecly).
using IDboxMobile.Controls;
using IDboxMobile.Helpers;
using IDboxMobile.Models;
using IDboxMobile.Platform;
using IDboxMobile.Resources;
using IDboxMobile.Services.Rest;
using IDboxMobile.Services.Settings;
using Refit;
using SMFramework;
using SMFramework.Views;
using Syncfusion.SfCalendar.XForms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace IDboxMobile.Views
{
public class CalendarView : BaseContentPage
{
public event EventHandler AcceptClicked;
SfCalendar calendar;
DateTime _startDate, _endDate;
public CalendarView(DateTime startDate, DateTime endDate)
{
ToolbarItems.Add(new ToolbarItem(AppResources.OK, "", AcceptButton));
ToolbarItems.Add(new ToolbarItem(AppResources.Cancel, "", CancelButton));
this._startDate = startDate;
this._endDate = endDate;
Content = GetLayout();
//SetDates();
this.BindingContext = new ViewModels.CalendarVM();
}
//private void SetDates()
//{
// List sdates = new List();
// for (DateTime i = this._startDate.Date; i <= this._endDate.Date; i = i.AddDays(1))
// {
// sdates.Add(i);
// }
// calendar.SelectedDates = sdates;
//}
private void AcceptButton(object sender, EventArgs e)
{
AcceptButton();
}
private void CancelButton(object sender, EventArgs e)
{
CancelButton();
}
private async void AcceptButton()
{
DateFilterEventArgs args = new DateFilterEventArgs();
try
{
if (calendar.SelectedDates != null && calendar.SelectedDates.Count > 1)
{
var orderedDates = calendar.SelectedDates.OrderBy(x => x).ToList();
DateTime startDate = orderedDates[0];
DateTime endDate = orderedDates[orderedDates.Count - 1];
bool fechaIncorrecta = (startDate.Date > endDate.Date);
args.startDate = fechaIncorrecta ? _startDate : startDate.Date;//do not change the dates if the user puts wrong dates
args.endDate = fechaIncorrecta ? _endDate : endDate.Date;
AcceptClicked(null, args);
await Navigation.PopModalAsync();
}
else
{
((ViewModels.CalendarVM)this.BindingContext).DialogService.ShowError(AppResources.SelectInitAndEndDates);
}
}
catch (Exception ex)
{
DependencyService.Get().WriteLogException(ex, CustomLogPriority.Error);
}
}
private async void CancelButton()
{
await Navigation.PopModalAsync();
}
private View GetLayout()
{
calendar = new SfCalendar()
{
MaxDate = DatesHelper.GetDateTimeNow(),
Locale = DependencyService.Get().GetCurrentCultureInfo(),
SelectionMode = SelectionMode.MultiSelection,
//SelectionMode = SelectionMode.RangeSelection, //cuando los de syncfusion nos respondan con cómo podemos seleccionar el rango entre meses.
};
calendar.SelectionChanged += Calendar_SelectionChanged;
return calendar;
}
private void Calendar_SelectionChanged(object sender, SelectionChangedEventArgs args)
{
//SetDates();
}
}
}