With my ConfiForms macro, I am creating pages in Confluence. These include a date, that is the date of the day of the upload. I have an additional date, that is calculated by adding to the decribed date 10 months. The problem with my approach is that this calculation is done with milli-seconds. Therefore if the current day is April 17, adding 26298000000 milliseconds, results not in February 17, but another date, because not every month has the same number of days, therefore the number of milliseconds, that happen in 10 months vary as well.
Is there a possible adaptation to my calculation, that allows to get a monthy-calculation rather than a calculation in seconds?
[entry._now.timestamp.add(26298000000).formatDate(yyyy-MM-dd, Europe/Rome).trimAllSpaces]
Hi @Christine B
Try using the _today variable instead
[entry._today.timestamp.add(26298000000).formatDate(yyyy-MM-dd, Europe/Rome).trimAllSpaces]
It does not have time
Alex
Thank you for trying, but with this solution I still have the same problem. The problem is, that the calculation should be the number of months and not days or time.
Example:
When I create a ConfiForm on April 18, 2024 I want an element that is date January 18, 2025. (Between those dates there are 275 days (=23 760 000 000 milliseconds))
When I create a ConfiForm on Febuary 10, 2024, I want an element is the date November 10, 2024. (Between those dates there are 273 days (=23 587 200 000 milliseconds))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, sorry, now I do understand what is your question. Not sure why you need that and what todo with for example with months that dont have 31 or 30 (Feb), but...
So, I would approach this as follows
[entry._today.formatDate(M).add(10).prepend([entry._today.formatDate(dd)]-).append(-[entry._today.formatDate(yyyy)]).parseDate(dd-M-yyyy).formatDate]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.