page icon

通讯录

数据源
通讯录
表格
根据生日日期获取今年/明年生日日期
今年生日日期:
dateSubtract(prop("生日"), -subtract(year(now()), year(prop("生日"))), "years")
明年生日日期:
dateSubtract(prop("生日"), -subtract(add(year(now()),1), year(prop("生日"))), "years")
现在和今年生日天数间隔:
dateBetween(dateSubtract(prop("生日"), -subtract(year(now()), year(prop("生日"))), "years"), now(),"days")
判断是否已经过了日期:
if(dateBetween(dateSubtract(prop("生日"), -subtract(year(now()), year(prop("生日"))), "years"), now(), "days") < 0, "过期了", "未过期")
过期了取现在到明年生日间隔天数:
if(dateBetween(dateSubtract(prop("生日"), -subtract(year(now()), year(prop("生日"))), "years"), now(), "days") < 0, ("💊 还剩 " +format(dateBetween(dateSubtract(prop("生日"), -subtract(add(year(now()),1), year(prop("生日"))), "years"), now(),"days") + 1)+ " 天"), "未过期")
过期了取现在到明年生日间隔天数,未过期取现在到今年生日间隔天数:if(dateBetween(dateSubtract(prop("生日"), -subtract(year(now()), year(prop("生日"))), "years"), now(), "days") < 0, ("💊 还剩 " +format(dateBetween(dateSubtract(prop("生日"), -subtract(add(year(now()),1), year(prop("生日"))), "years"), now(),"days") + 1)+ " 天"), ("💊 还剩 " +format(dateBetween(dateSubtract(prop("生日"), -subtract(year(now()), year(prop("生日"))), "years"), now(),"days"))+ " 天"))
 
计算两个日期之间天数间隔
empty(prop("生日")) ? "" : ("💊 还剩 " + format(dateBetween(now(), prop("生日"), "days")) + " 天")