Given a field called Birthday
(of which only the day and month are used), the Next Birthday Formula will be the date of their next birthday. It will be this year if their birthday hasn't passed yet, or next year if it is past their birthday.
Made by @lpghatguy and @evaera
if(empty(prop("Birthday")), prop("Birthday"), dateAdd(dateAdd(dateAdd(dateAdd(fromTimestamp(0), toNumber(formatDate(prop("Birthday"), "D")) - 1, "days"), toNumber(formatDate(prop("Birthday"), "M")) - 1, "months"), toNumber(formatDate(now(), "Y")) - 1970 + if(toNumber(formatDate(now(), "M")) >= toNumber(formatDate(prop("Birthday"), "M")), if(toNumber(formatDate(now(), "D")) > toNumber(formatDate(prop("Birthday"), "D")), 1, 0), 0), "years"), 24 - toNumber(formatDate(fromTimestamp(0), "H")), "hours"))
Hi, is there any way you could explain how this formula works?
I'm not sure how to apply it to my use case. My team wants to be able to hide the age of the person - so not save any year, but still have a calendar :"D