25 Sep 2017
Link to this post
I have an issue when setting the maxDate of a dateTime picker from javascript.
For minDate it works but when trying to set the maxDate it won't to note that no error is raising the scenario is when choosing issue date the valid date minDate will be = the chosen issue date and if user chooses the valid date before the issue date maxDate should be = the chosen valid date
Here is the javascript code:
--works for MinDate
tpc.forms[0].issuedate.add_valueChanged(function()
{
tpc.forms[0].validdate.get_model().MinDate = new Date(tpc.forms[0].issuedate.get_displayInput()[0].value);
tpc.forms[0].validdate.set_model(tpc.forms[0].validdate.get_model());
});
--not working for MaxDate
tpc.forms[0].validdate.add_valueChanged(function()
{
tpc.forms[0].issuedate.get_model().MaxDate = new Date(tpc.forms[0].validdate.get_displayInput()[0].value);
tpc.forms[0].issuedate.set_model(tpc.forms[0].issuedate.get_model());
});