Hello guys, I am currently facing an issue with the value type of datetime\diff().
I have this variable $pocetDnuKonecEtapy = datetime\diff(aktualEtapaKoniec, datetime\today(), 'days') which returns -1.
But when I want to use this in the string\replace() function it does not work.
This is still returning 'Do konce etapy: {dny}' even if the variable returns -1.
The problem is that datetime\diff() is not a string, not even a number (I tried it in the Formula Sandbox see code below).
So what type is it and how can I use it in the string\replace() please? Is there any way how to convert it to string, please?
Thanks a lot in advance!
I have this variable $pocetDnuKonecEtapy = datetime\diff(aktualEtapaKoniec, datetime\today(), 'days') which returns -1.
But when I want to use this in the string\replace() function it does not work.
Code:
$upozorneni = string\replace('Do konce etapy: {dny}', '{dny}', $pocetDnuKonecEtapy);
The problem is that datetime\diff() is not a string, not even a number (I tried it in the Formula Sandbox see code below).
Code:
$pocetDnuKonecEtapy = datetime\diff(aktualEtapaKoniec, datetime\today(), 'days') returns -1 $pocetDnuKonecEtapy == -1 returns false $pocetDnuKonecEtapy == '-1' returns false
Thanks a lot in advance!
Comment