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

Nintex Forms: Set min date and max date for date time picke

Hello,

 

I have two date time picker. They should represent the travel time.

The 'ArrivalDate' starts (minDate) with the current date.

The 'LeaveDate' starts (minDate) with the 'ArrivalDate', so the user can't select any date before the arrival date.

 

Additionally I got tow more date time picker: 'OutwardFlightDate', 'ReturnFlightDate'.

The 'OutwardFlightDate' starts (minDate) with the 'ArrivalDate' and ends (maxDate) with the 'LeaveDate'.

The 'ReturnFlightDate' starts (minDate) with the 'ArrivalDate' and ends (maxDate) with the 'LeaveDate'.

 

Now I only can set the value for all the date time picker (minDate = new Date ()):

 

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

 

Thank you for your help,

Ronja

Labels: (1)
0 Kudos
Reply
1 Reply
Highlighted
Nintex Newbie

Re: Nintex Forms: Set min date and max date for date time picke

Try this JS

 


NWF.FormFiller.Events.RegisterAfterReady(function () {

 NWF$('#'+ArrivalDate ).change(function()
 {
  var dateval=NWF$('#'+ArrivalDate).datepicker('getDate');
  NWF$('#'+LeaveDate ).datepicker('setDate', dateval);
  NWF$('#'+LeaveDate ).datepicker('option',{minDate: new Date(),maxDate: dateval});
 });
});

Reply