Date calculations error

I make an apps to manage clients of midwifes. I need to make calculations with dates.

The “date of delivery” (DPA) is set by the user and the beginning date of the pregnancy (DDM) is calculate in the background (“DDM = DPA - 280”. 280 days: theoric duration of a pregnancy).

DDM and DPA are Date properties (not DateTime). Sometime, calculation are OK and sometime, one day is missing.

I made a lot of tests to try to understand the issue. It’s seems related on how Adalo keep datas (even for Date, the time is keep internally) and on timezone (the days difference occurs when time is before/after 7:00PM).

It’s been days that I think to a solution and try different things. Nothing works.

I need an Adalo Expert to find a solution. If you have any ideas, please let me know and give me your devis ($). Thanks.

Hello, I’m ready to help. This is my email : ali.bazzi2002@gmail.com

Thank you!

Hello amber, I think I know how to get it done

Hi @Amber ,

I would suggest you to have date time as well, whenever the user pick a date using form or date picker, update the date time field too.

Calculate another date time using the updated date time, then update another date field based on this.

Here is from Komun template.

1 Like

I would just integerise the date time calculation.

INT(date1-date2)

Hi!

Thanks all for your answers.

Yongki give the solution :slight_smile: