Calculate Due Dates and Time

Hello,

I am building a database that will track the maintenance of equipment. I need to calculate the next due date for inspections/maintenance intervals based on the last date of inspection and the legal limit for the MX interval. A scenario would be as such:

Date of the last inspection: 11/16/2020
Interval: Due on the last day of the 24th calendar month

Due Date: 11/30/2022

Is this possible to calculate in Bubble? and if so, how?

An additional scenario is such:

Usage time on equipment at last inspection: 150 Hours
Interval: up to 100 hours

Due: at 250 hours

Yes, you can do this in Bubble.

Getting the last day of the month is a bit tricky, but here is how I would do it.

Date of Last Inspection’s Date+Years(2),+months(1),change Day to (1),+days(-1). The last bit takes it from Dec 1, 2022 to Nov 30, 2022.

You will also need a conditional when the date is December because the year will be off. You’ll need to add an extra year (3).

The second scenario is pretty easy.

2 Likes

Absolutely possible.

Perhaps this video by @romanmg might present some concepts around the functionality to want to build > Working with Dates in your Bubble.is App

1 Like