Community

Connect with us and enhance your M-Files experience using Unitfly Toolkit for M-Files. Here’s how to get started.

Notifications
Clear all

[Solved] Extended Auto Properties - calculate Vacation days

0
Topic starter

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. 

image

 

image

I'm curious if this is something that can be fixed or changed? Thanks!

3 Answers
0

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.

0
Topic starter

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.

0
Topic starter

Thank you Tadej, looking forward for this feature!

Answer

WATCH THE WEBINAR

Introducing AI Document Kit: Add-on for AI-driven Document Management