How to calculate number of days from 2 date pickers

how to calculate number of days from 2 date pickers

hello) I can’t understand something, I want to get qty days, in the question, the start date is the end date. What functions need to be done to calculate the number of days?

Hey @TonyS,

Add a numeric property to some collection (e.g. Users) to store the resulting number of days. Add an action to update this property’s value with a Datepicker2 - Datepicker1. You will get a difference in days (and day fraction) as a result.

Best,
Victor.

1 Like

works perfect, thanks

1 Like

Victor, how can I make sure that this data is updated for each user and is for each user? now I did as you wrote and it works fine, but the problem is that if another user presses the dates, they are updated and the first user has the same way to avoid this? many-to-many relationship? creating a separate base? i’m still trying to figure out how to do it

You can store the dates in the properties of Logged-in User.

Of course if you are using some other collection and you’re trying to change the dates for same record in this collection by different users, you will face issues as users will overwrite each others’ changes.

You may need an extra “junction table” to store these dates then.

It is difficult to advise more as you haven’t provided any additional info about your task.

Best,
Victor.

1 Like

did, works perfect! thank you for your reply, all the best

1 Like

Victor can you answer this question: how to set the cost for different dates? the logic is this: I book 5 days of training and there is 1 cost for them, but one of these days falls on a weekend and the cost should be higher when booking, how to combine these 2 or more costs on different days?