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

Version 20.3.0.59 Datepicker increases the memory when the Max value is equal to Datetime.Now

Hello,

I am using the Datepicker component at my project and I updated the Syncfusion Blazor nuget to version 20.3.0.59.


After that every time I clicked at the Datepicker the memory of my project started increasing a lot and after testing it more I realized that this was happening because I had set the Max date to be equal to Datetime.Now.


I would like your help to solve this because it leads to memory leak

I am posting an example to reproduce the issue.


Thanks in advance!





Attachment: BlazorApp1_a33fea8.zip

1 Reply 1 reply marked as answer

UD UdhayaKumar Duraisamy Syncfusion Team December 6, 2022 06:33 AM UTC

You can assign a DateTime variable to a separate variable bound to the Max property. This is the preferred method of using the Max property.


<SfDatePicker TValue="DateTime"

              Placeholder='Choose a Date'

              @bind-Value=@testCalendar

              Format="dd-MMM-yy"

              Width="150px"

              ShowClearButton="true"

              ShowTodayButton="true"

              Enabled=true

              Max="@MaxDate"></SfDatePicker>

 

@code{

    private DateTime testCalendar = DateTime.Now;

    public DateTime MaxDate = DateTime.Now;

}

 


Documentation : https://blazor.syncfusion.com/documentation/datepicker/date-range


Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon