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

Year Range issue with Date Picker Control on Nintex Form

Jump to solution

Hi,

We have in issue with Date Picker control on Nintex Form.  The year range is displayed on the form is for the last 10 years only. If we select a year it then goes back to another 10 years.  How can I change the year range to display last 100 years by default?

Out Nintex form version is 2.3.3.1 and we run it on SharePoint 2013.

Thanks

Tony

Reply
9 Replies
Highlighted
Automation Master
Automation Master

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

you can configure it, but only with a javascript

NWF.FormFiller.Events.RegisterAfterReady(function(){
   NWF$('#' + dateCtrl).datepicker('option',{
       yearRange: "-50:+50",
   })
})

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

Thanks so much.  It worked for me.

Reply
Highlighted
Automation Master
Automation Master

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

Great!

Please mark the question answered.

Reply
Highlighted
Nintex Newbie

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

This is exactly what I needed!

In my case, I have a large form with a number of Date Picker controls. So, I actually made a slight change to the code to make it work for all Date Picker controls across the form, and not require any setting changes to the individual controls.

I've replaced this:

NWF$('#' + dateCtrl)

with this:

NWF$('.nf-date-picker')

Thank you once again Marian Hatala‌!

Reply
Highlighted
Nintex Newbie

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

Ok, so how about those of us using responsive forms? I need a date of birth field, and going back only 10 years is a huge problem. 

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

unfortunatelly, with responsive forms you're out of luck...

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution
Newbie question...do I just copy and paste the above code into Settings > Custom JavaScript ? I've tried and nothing happens.
0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

You need to link the function to your action, unless you use @chaddavis  solution to apply it to every date picker action on your form.

To use the function on a single action as @emha suggested do the following:

  • Open your Date Picker action
  • go to Advanced
  • Change 'Store Client ID in JavaScript variable' to Yes
  • type 'dateCtrl'.

You can type the ID name you like,  but you have to make sure you update the function as well.

NWF.FormFiller.Events.RegisterAfterReady(function(){
   NWF$('#' + dateCtrl).datepicker('option',{
       yearRange: "-50:+50",
   })
})

 

Hopefully this helps

Reply
Highlighted
Nintex Newbie

Re: Year Range issue with Date Picker Control on Nintex Form

Jump to solution

con esta funcion puesta en la zona de javascripr de la configuracion del formulario me funciona perfecto, hice un par de ajustes


NWF$(document).ready(function() {  
NWF$('.nf-date-picker').datepicker('option',{
       yearRange: "-50:+50",
   })
})
0 Kudos
Reply