09/22/2023 04:09 AM
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!
Solved! Go to Solution.
09/23/2023 08:18 AM
Hello,
Just an idea :
${new Date().plus(90).format("MMM dd, yyyy")}
It will add 90 days (3 months)
Regards
09/26/2023 01:24 AM
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
09/27/2023 07:48 AM
[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
10/05/2023 12:10 AM
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.