cancel
Showing results for 
Search instead for 
Did you mean: 
returntrust
Nintex Newbie

How to limit date picker range?

Jump to solution

Hello all!

I was curious if there is a way to limit the date/time control to only allow dates to be selected for past 7 days and current day, no further forward or back?

Thanks! 

Labels: (2)
Reply
5 Replies
tbeduneau
Nintex Newbie

Re: How to limit date picker range?

Jump to solution

Not on selection, but you can define a validation rule that prevent the form to be submitted if date is not in your range.

0 Kudos
Reply
returntrust
Nintex Newbie

Re: How to limit date picker range?

Jump to solution

Found a javascript solution!

NWF$('#' + datebook).datepicker('option',{minDate: '-7d',maxDate: Current Date});

Thanks for the help! 

0 Kudos
Reply
sakhatri
Nintex Newbie

Re: How to limit date picker range?

Jump to solution

Thanks for the solution.

But this is a part of jQuery UI DatePicker , am i right ? To make use of your code one must have or refer the jQuery UI js file.

0 Kudos
Reply
bcobra
Nintex Newbie

Re: How to limit date picker range?

Jump to solution

I was able to accomplish like this:

Set date picker min val to today:

NWF$(document).ready(function(){

NWF$.datepicker.setDefaults({minDate: new Date()});

});

this sets all datepickers. If I want to set just a single date picker to set the min date to be the date of another datepicker selection it doesn't work:

NWF$("#"+ minDval).on('change',function(){
var minD=NWF$("#"+ minDval).val();
var retD=NWF$("#"+rDval);

retDval.datepicker.setDefaults({minDate: new Date(minD)});
});

any ideas?

0 Kudos
Reply
Alejandro
Nintex Newbie

Re: How to limit date picker range?

Jump to solution

Hi @bcobra ,

 

Sorry my english isn't very well but I solved your question.

 

I did it to put min date to specific date picker in nintex forms.

NWF$('#' + varFechaDonacion).datepicker('option',{
minDate: new Date(),
});

 

Where "varFechaDonacion" is variable javascript

0 Kudos
Reply