<aside> <img src="https://super.so/icon/dark/edit.svg" alt="https://super.so/icon/dark/edit.svg" width="40px" /> Post Outline
<aside> <img src="https://super.so/icon/dark/file.svg" alt="https://super.so/icon/dark/file.svg" width="40px" /> THE SAVINGS CALCULATOR
</aside>
The savings calculator determines how many months into the future it will take to save for a particular item. If there is no Start date applied, the End formula will calculate from today's date until Start is filled.
Properties
End: formula property
if(empty(prop("Start")), dateSubtract(dateSubtract(dateAdd(now(), prop("Cost") / prop("Save per Month"), "months"), hour(now()), "hours"), minute(now()), "minutes"), dateAdd(prop("Start"), prop("Cost") / prop("Save per Month"), "months"))
Formula breakdown
Statement 1: Make prediction for approximate end date from today if Start property is empty. Also ensure that the resulting date has time “12:00am.”
Statement 2: Make prediction for end date from Start property. This is the false condition, or when the above statement does not apply.
<aside> <img src="https://super.so/icon/dark/file.svg" alt="https://super.so/icon/dark/file.svg" width="40px" /> WHY CONVERT DATE TO 12:00AM?
</aside>
It is good practice to convert date calculations from now(), or today, into dates with a 12:00am time. The now() function includes today’s time, so any addition or subtraction to now() will have a time. 12:00am can indicate that the date spans the entire 24 hour day.
You can also format a date to only show the date without the time.
However, this will result in a text property and NOT a date that can be viewable in a calendar.
<aside> <img src="https://super.so/icon/dark/file.svg" alt="https://super.so/icon/dark/file.svg" width="40px" /> SAVINGS TRACKER DATABASE
</aside>
The Track Savings database allows the user to add new cards for every input amount into a savings item. Upon clicking a new card, the monthly amount assigned to the item will automatically be added.
<aside> <img src="https://super.so/icon/dark/file.svg" alt="https://super.so/icon/dark/file.svg" width="40px" /> ADJUSTED END DATE FORMULA
</aside>
Determine what the adjusted end date is from the amount of money saved. This is a separate formula in the Savings Calculator using the above rollup property.
Adjusted End Formula
dateSubtract(dateSubtract(dateAdd(now(), (prop("Cost") - prop("Amount Saved")) / prop("Save per Month"), "months"), hour(now()), "hours"), minute(now()), "minutes")
</aside>