电子邮件-html中政策的日期范围

时间:2019-12-11 22:47:00

标签: html conditional-statements

我正在尝试在电子邮件中插入特殊的取消政策,并希望显示2种不同的取消政策,具体取决于到达日期有多远。使用条件语句IF,这样的HTML会是什么样子?

如果到达日期距离现在不到30天,请显示文字A 如果到达日期是330-365天-显示文字B 如果到达日期超过365天-显示文字c

这是我所拥有的但不起作用

    {% assign check_in_day = reservation.check_in | date: "%j" | times: 1 %} 
{% assign todays_doy = now | date: "%j" | times: 1 %} 
{% if ((check_in_day - todays_doy) < 30) %}Text A
{% elsif ((check_in_day - todays_doy) >= 30) and ((check_in_day - todays_doy) <= 365) %}Text B
{% else %}Text C
{% endif %}

0 个答案:

没有答案