Hi,
I have a date in a calculated field and I need to calculate the date plus 3 days for example. How to write it in Java Script. I also have a “signature date” field (2.1. 2023 - enter the date).The result 5.1.2023 should be displayed as a date.
Thanks
micu
January 27, 2023, 12:37pm
#2
Hi,
Some tips about working with dates are already sorted out in FAQ. E.g.
In my application I calculate the duration as follows:
doo.model.duration.value = (doo.model.end.value - doo.model.start.value)/3600000;
When I switch to the New TypeScript editor, the entire expression is underlined with a red wavy line. And the message "The left-hand side of an arithmetic operation must be of type ‘any’. ‘number’. …
The calculation in the form works correctly, but NaN is printed on the console.
If I create Duration as calculated field: end - start, the result is always 000…
Just keep on mind that we store the date as ISO string, so you need to convert it first.
new Date(new Date(myDate).setDate(new Date(myDate).getDate() + 3))
Regards
Michal