Date calculation and formatting



I have a text box DeliveryDate formatted as Date/Time with binding set to Data Format "DATE" and all patterns set to "MMMM D, YYYY" (which should result in January 5, 2015, etc.).  Dates are picked via the drop down.

I have a floating field LateDueDate formatted as Text, no patterns set.

I am trying to take DeliveryDate and add 30 days and have the result populate LateDueDate.

In the Exit event of DeliveryDate (using FormCalc) I have the following:

EVI_Contract.EVI_Main.PaymentTerms.LateDueDate.formattedValue = Num2Date(Date2Num($.rawValue, "MMMM D, YYYY")+30);


Using various combinations of Num2Date and Date2Num, I have been able to get the function to work on months with short names, i.e. May 1, 2015 will correctly fill LateDueDate with May 31, 2015.  January 1, 2015 results in Jan 1, 1900 - which I recognize is a formatting error -but for the life of me I can't find how to correct it.  I've tried every combination of Num2Date(Date2Num($.rawValue, "MMMM D, YYYY")+30); I can think of, including Num2Date(Date2Num($.rawValue, "MMMM D, YYYYY")+30, "MMMM D, YYYY") and Num2Date(Date2Num($.rawValue +30);, etc.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)