@melon, you can use math.js to do this and I think there are other plugins that do similar things. But it’s very simple to do with standard Bubble features as well.
http://www.giphy.com/gifs/cKWOkK50LvFGe1lH4D
The first thing you have to do is convert the dates to a number we can run math operations on so we can subtract the current date from the payment date. To do this we will use the :extract operator on the end of the date value.
In the options here, we could extract the Date which will give us the day of the month, however, that won’t take into account for crossing over the end of a month.
For example, if my payment date is August 31 and the current date is August 15 that will work fine. We can extract the days and take 31 minus 15 and get an accurate answer of 16.
However, in that same scenario, if my payment date is September 5 then it won’t work because we are calculating 5 minus 15 for an answer of -10 days til my payment is due. Obviously that is incorrect.
The option we want to extract from each date is the UNIX timestamp (ms) and then subtract the Current date’s UNIX timestamp (ms) from the Payment date’s UNIX timestamp (ms). This will give us the time between both dates in milliseconds.

The formula for finding the days then is to simply divide the milliseconds by 86,400,000 (1,000 milliseconds per second * 60 seconds per minute * 60 minutes per hour * 24 hours per day).
You will need to format as number and set the decimals to 0 so you get whole days.
The entire formula will look like this:


