Connect with us and enhance your M-Files experience using Unitfly Toolkit for M-Files. Here’s how to get started.
Hi Everyone,
So i tried replicating this use case on our environment - https://toolkitformfiles.unitfly.com/documentation/extended-auto-properties-use-cases/
But what I noticed is that DATEDIFF is missing either first or last day, like the calculation of days starts from 0, not 1.
Meaning that the person requesting Vacation, should be using 5 days, which is the case here. I tried adding +1 day in Property Value Field but does not seem to work.
I'm curious if this is something that can be fixed or changed? Thanks!
Hi @karloadanic
A slightly better solution is this one:
<<DATEDIFF('<<DATEADD('%PROPERTY_{PD.EndDate}%','1','DAYS')>>','%PROPERTY_{PD.StartDate}%','DAYS')>>
However, it will still calculate the wrong value if the start date falls on a weekend or holiday. But it will work correctly if only the end date is a weekend or holiday.
To address this case, we will add a new feature in one of the upcoming releases.
i fixed this by adding +1 with this statement: <<SUM('<<DATEDIFF('%PROPERTY_{PD.StartDate}%','%PROPERTY_{PD.EndDate}%','DAYS')>>','1')>> but it would be good to add a feature which checks this. This plus one then calculates 6 days if user selected from Sunday to Sunday value, taking this +1 into consideration.
Thank you Tadej, looking forward for this feature!
So, you came to the end of the page. This means you are passionate about technology as we are.
WATCH THE WEBINAR