MinDate/MaxDate not respected

We have implemented the CalendarEdit control in this way, but the MinDate/MaxDate are not respected when the control is shown: Dates beyond MinDate/MaxDate are shown and selectable:

<sf:CalendarEdit x:Name="PopupKernFormStatusCalendar"
 Date="{Binding Mode=OneWay, Path=DataContext.AssociatedObjectDataContext.CalendarMaxDate, RelativeSource={RelativeSource AncestorType={x:Type Popup}}}"
 MinDate="{Binding Mode=OneWay, Path=DataContext.AssociatedObjectDataContext.CalendarMinDate, RelativeSource={RelativeSource AncestorType={x:Type Popup}}}"
 MaxDate="{Binding Mode=OneWay, Path=DataContext.AssociatedObjectDataContext.CalendarMaxDate, RelativeSource={RelativeSource AncestorType={x:Type Popup}}}"
 MinMaxHidden="True" IsShowWeekNumbers="True" ScrollToDateEnabled="True" VisualMode="Days" Margin="5 0 5 0"/>

The MinDate/MaxDate properties are read from the ViewModel correctly when the control shows, but all dates are shown and selectable:

/// <summary>
/// Min/Max dates for popup calendar
/// </summary>
public DateTime CalendarMinDate
{
get => DateTime.Today.AddMonths(-3);
}
public DateTime CalendarMaxDate
{
get => DateTime.Today;
}

What are we having here that the MinDate/MaxDate properties are not respected? The culture used is "de-DE".

Thanks for your support.





9 Replies

SN Sudharsan Narayanan Syncfusion Team September 17, 2021 03:42 AM UTC

Hi Michael,

We have checked the reported issue that “Max/Min Date are not respected” from our side. We have prepared the sample to replicate the issue but, we are unable to reproduce the issue. Please find the sample from the below location,

Sample: https://www.syncfusion.com/downloads/support/forum/168878/ze/CalendarEditMinMax2099527619

If we are misunderstood the query, please modified our sample with
the issue reproducible and video for the same with steps. It will be helpful to prompt the solution.

Regards,
 
Sudharsan


MP Michael Pillwax November 23, 2021 06:14 PM UTC

Hello,

attached is the sample application that replicates the issue we are having. From preparing it we learned the following:

  1. The issue may be related to using a DataTemplate for the Popup, where the Calendar is used.
  2. It may also be related to a data binding issue when using the Calendar Min/Max Date properties with a binding in the DataTemplate, although the Date property is working properly with binding.
The attached code replicated the issue here with us exactly as in our application.

Thanks for looking into this.

Attachment: WpfApp1_dbf6aed5.zip


SN Sudharsan Narayanan Syncfusion Team November 25, 2021 03:58 AM UTC

Hi Michael,

Thanks for the update,

Currently, we are analyzing your reported issue of “Mix/Max date not respected”. We will validate and update you the details on or before 26th November 2021.

We appreciate your patience until then.

Regards,
Sudharsan



SN Sudharsan Narayanan Syncfusion Team November 30, 2021 03:48 AM UTC

Hi Michael,

Thanks for the patience,

We have logged a bug report on “
Mix/Max date not respected” from our end. The fix for the issue will be available by patch on 13th December 2021. You can track the status of the issue using the feedback link below.   

Feed Back : https://www.syncfusion.com/feedback/30763/binding-of-min-and-maxdate-is-not-working-in-datetimeedit

We appreciate your patience until then.

Regards,
Sudharsan
 



MP Michael Pillwax November 30, 2021 11:49 AM UTC

Thanks for the reply, glad to be helpful in improving the control. Will provide feedback when the update is available.



SN Sudharsan Narayanan Syncfusion Team December 17, 2021 02:57 AM UTC

Hi Michael,

We were unable to provide the fix for the reported issue as promised. Please let us know the version you are currently using in your project. On your current version, we will provide the fix.

Regards,
Sudharsan



SN Sudharsan Narayanan Syncfusion Team December 28, 2021 02:40 PM UTC

Hi Michael,

The reported issue with the CalendarEdit control has been fixed and included in Weekly NuGet [19.4.0.40] version. You can refer it in Nuget.org. 

 
NuGet Link: https://www.nuget.org/ 

Please let us know if you need any further assistance on this, we will be glad to assist you.

Regards,
Sudharsan



MP Michael Pillwax January 8, 2022 04:26 PM UTC

Hello  Sudharsan,


thanks for the efforts, we can confirm that with the update 19.4.0.40 or above the issue can now be closed. The min/max dynamically set behave now as intended.


Thank you.



SN Sudharsan Narayanan Syncfusion Team January 10, 2022 12:31 PM UTC

Hi Michael,

 
We are glad to know that your issue has been fixed. Please let us know if you need any other assistance. We are happy to assist you.

Regards,
Sudharsan
 


Loader.
Up arrow icon