Hello Alex,
your help would be very appreciated, I’m quite lost even this issue looks so simple.
1. I have a date and time column (just date) – ‘positiveSince’
2. I have another date and time column (just date) – ‘positiveTo’
I need to get a date based on user’s input from ‘positiveSince’ column and with a rule to trigger a custom function to copy this date and add 14 days forth.
I’ve tried something like this and it’s working until I choose 31st December, it adds 14 days, so the output is 31+14 = 45. 12. 2020 (for example).
The output should be logical – 14th January 2021 (14. 1. 2021).
function endOfQuarantine() {
let d = spjs.utility.getDateFieldAsDateObject('positiveSince');
let den = d.getDate()+14;
let mesic = d.getMonth()+1;
let rok = d.getFullYear();
console.log(den +". "+ mesic + ". "+rok);
}
I’d be glad if you can help me to figure it out.
Steo
-
This topic was modified 3 years, 10 months ago by Steve.