Nintex Observer

Need a returned value as "date" using Calculated Value form control - pls help!


I'm trying to yield a date value using calculated value form. Tried and not working, can you pls help 🙂

The form is for employee to add their child birth date (time/date form), and another field should yield the date 6 years after the given date, which I cannot make it happen.

i use calculated value form and put in this formula, and when i tried preview the form, it kept saying 'yesr' is undefined.

example of what i simply want is, i.e. selected BD is 15-MAY-2014, the yield value should be 15-MAY-2020.  Thanks a bunch


to select BD







error msg



0 Kudos
1 Reply
Process Pupil

Re: Need a returned value as "date" using Calculated Value form control - pls help!

Too bad it's not as simple as we hope it would be. However, there is another post on the community that solves this issue. Please check out and see if that works for you!


The answer from Eric Beeler:

I received some help on the JavaScript and got the dates to work. I needed to add validateStoredDate(); after the ready function. The first date is +2 days and the second one is today's date.


So my full script reads as followed:



function validateStoredDate(source, arguments)
  var varStoredDate = NWF$('#' + varStoredDateID);
  var varCalculatedDate = NWF$('#' + varCalculatedDateID);


  // get date from first date picker
  var depart = parseDate(varStoredDate.val(),'mm/dd/yy');


  // add 129 days to the retrieved date
  depart.setDate(depart.getDate() + 2);


  // update second date picker


  arguments.IsValid = true;


function parseDate(dateString, userFormat) {
    var delimiter, theFormat, theDate, month, date, year;
    // Set default format if userFormat is not provided
    userFormat = userFormat || 'yyyy-mm-dd';


    // Find custom delimiter by excluding
    // month, day and year characters
    delimiter = /[^dmy]/.exec(userFormat)[0];


    // Create an array with month, day and year
    // so we know the format order by index
    theFormat = userFormat.split(delimiter);


    //Create an array of dateString.
    theDate = dateString.split(delimiter);
    for (var i = 0, len = theDate.length; i < len; i++){
      //assigning values for date, month and year based on theFormat array.
      if (/d/.test(theFormat)){
        date = theDate;
      else if (/m/.test(theFormat)){
        month = parseInt(theDate, 10) - 1;
      else if (/y/.test(theFormat)){
        year = theDate;
    return (new Date(year, month, date));

0 Kudos