Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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

Avatar

Former Community Member

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

Avatar

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

Avatar

Former Community Member

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