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.
Syncfusion Feedback

Min/Max date for datepicker

Thread ID:

Created:

Updated:

Platform:

Replies:

128059 Dec 29,2016 01:08 AM Jan 2,2017 07:31 AM ASP.NET MVC 1
loading
Tags: Gantt
Kuntal Patel
Asked On December 29, 2016 01:08 AM

Hello,

I want to restrict date selections to some range in Gantt. e.g. Start date and end date should be between a defined range. It will be fine if it can be set during Gantt initialization or at the time of editing the date fields.

How to set min/max dates for date picker at the time of editing the Gantt?

Suriyaprasanth Ravikumar [Syncfusion]
Replied On January 2, 2017 07:31 AM

Hi Kuntal, 
Thanks for contacting Syncfusion support. 
We can set the maximum and minimum date to start date and end date column in Gantt by add editParams property to these columns. 
We have added minDate and maxDate value in editparams  of  start date and end date columns in “Load” client side event. 
Please find the code snippet below. 
@(Html.EJ().Gantt("GanttContainer") 
  //.. 
.ClientSideEvents(eve => 
                                      { 
                                          eve.Load("load"); 
                                      }) 
  //.. 
) 
 
 
function load() { 
                var column = this.getColumns(); 
                for (var index = 0; index < column.length; index++) { 
                    if (column[index].editType === "datepicker") { 
                        column[index].editParams = { minDate: "02/23/2014", maxDate: "03/30/2014" }; 
                    }  
                   } 
              } 
 
We have also prepared the sample for your reference, please find the sample from below location.  
  
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, 
we must include Syncfusion.EJ and Syncfusion.EJ.MVC dlls to render the Gantt control which is available in Essential studio installed location. 
Please let us know if you require further assistance on this. 
 
Thanks, 
Suriyaprasanth R. 


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.

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

;