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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the start date of datepicker.

Thread ID:

Created:

Updated:

Platform:

Replies:

107195 Feb 19,2013 10:57 AM UTC Feb 20,2013 12:13 PM UTC ASP.NET MVC (Classic) 1
loading
Tags: Tools
Devendar
Asked On February 19, 2013 10:57 AM UTC

Hi,
 
I am unable to set the start date of datepicker in syncfusion.
Could you help me to set the start date of datepicker from the model in mvc using razor.
 
Thanks in advance.
 

 


Meena [Syncfusion]
Replied On February 20, 2013 12:13 PM UTC

Hi Devendar,

 

Thanks for contacting Syncfusion forums.

 

Your requirement setting the start date in Datepicker can be achieved using MinDate property of the control. Please refer the below code snippet.

 

<code>

        public ActionResult Index()

        {

            DatePickerModel model = new DatePickerModel();

           

            //To set the start date                                     // You can also set the date like this         

            model.MinDate = DateTime.Today.Date;                        model.MinDate = new DateTime(2013, 01, 10);

 

            //To set the end date

            model.MaxDate = DateTime.Now.AddMonths(5);                  model.MaxDate = new DateTime(2013, 12, 10);

                    

            // To set the deafult date

            model.DefaultDate = new DateTime(2013, 02, 20);

            model.DisplayDefaultDateOnLoad = true;

 

            ViewData["date"] = model;

            return View();

        }

 

 

</code>

 

We have also prepared a simple sample for your convenience and it can be downloaded from the below link.

 

Kindly have a look at the sample and let us know if it helps.

 

Regards,

Meena



Datepicker_TestSample_fa461af1.zip

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;