Search code examples
xpagesxpages-ssjs

(XPage/JS svr-side)How to calculate the year, month and day two weeks from today?


var TODAY_TEMP = @Text(@Year(@Today()))+@Right("0"+@Text(@Month(@Today())),2)+@Right("0"+@Text(@Day(@Today())),2);

I need to calculate two weeks from today, I already get today, but I don't know how to get the date of after two weeks.

So sorry... I'm not familiar with how to write programs on the javascript server-side...


Solution

  • Use the @Adjust function. Example:

    @Adjust(@Today(), null, null, 14, null, null, null);