Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

"currentdate" Function in forms

alanrojas
New Contributor
New Contributor

Good morning,

I am trying to add a default value to an attribute of EndDate, and I was wondering if is it possible to add months instead of days in the currentdate function, I have looked in the documentation but I couldn't find  anything aside of this: Setting Up Simple Form Fields (saviyntcloud.com). Thanks!

4 REPLIES 4

mickeymouse
New Contributor III
New Contributor III

Hello,

Just an idea : 
${new Date().plus(90).format("MMM dd, yyyy")}

It will add 90 days (3 months) 

Regards 

Hello,

I was looking for a function (maybe) where it would take into account the month of the year to count the days so the date that it will show 3 months on the future, would be an exact one, e. g.:

- Actual date -> SEP 26, 2023.

- Date to show -> DEC 26, 2023.

Best regards

[correction of the previous question]

Hello,

I was looking for a function (maybe) which would take into account the actual month of the year in order to count the total amount of days, so the date that it will show will be exactly 3 months in the future, e. g.:

- Actual date -> SEP 26, 2023.

- Date to show -> DEC 26, 2023.

Best regards

Hi @alanrojas , As per my understanding, the requirement is to add x number of months keeping the date same irrespective of actual number of days between them. I believe this scenario is not feasible. 

Please consider the example below. 

Actual date is 30 Nov 2023

Display date will be 30 Feb 2024

However, 30th of Feb doesn't exist.

Similarly the below one.

Actual date 31 Jan 2023

Display date 31 April 2023

31st April doesn't exist.

Please let me know if you have further query.

Regards,
Dhruv Sharma
If this reply answered your question, please accept it as Solution to help others who may have a similar problem.