Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How do you subtract X number of weeks from a Date Field/

Pbhul
Level 1
Level 1

Looking for a Script for subtracting X number of weeks from a Date Field.

Presently, Date Field is named RTL, Number of Weeks Numerical Filed is named NumericalField6.

Result Filed is aDtae field named DSPSE.

Thanks.

2 Replies
Magus069
Level 10
Level 10

Hi there,

Here are the best scripts to work with dates with JavaScript in LiveCycle Designer

Enjoy, hope this will help ya!

Adobe LiveCycle Designer Cookbooks by BR001: Date handling in Livecycle Designer ES forms

Pbhul
Level 1
Level 1

DSPSE=Num2Date((Date2Num(RTL.formattedValue,"MM/DD/YYYY")-NumericField6*7),"MM/DD/YYYY")

I am using FormCalc to get durations(weeks)  from a given date and working back to obtain other Milestone dates.

Getting aprompt message everytime I add a duartion " Validate DSPSE".

Thanks.

Pbhul