我需要在HTML或JS中创建一个条件的自动更新日期。以下是在Excel中创建的示例:
Delivery Date Delivery
Monday, 30.04.18 Saturday, 05.05.18 1
Tuesday, 01.05.18 Saturday, 05.05.18 1
Wednesday, 02.05.18 Saturday, 05.05.18 1
Thursday, 03.05.18 Saturday, 12.05.18 2
Friday, 04.05.18 Saturday, 12.05.18 2
Saturday, 05.05.18 Saturday, 12.05.18 2
Sunday, 06.05.18 Saturday, 12.05.18 2
Monday, 07.05.18 Saturday, 12.05.18 2
Tuesday, 08.05.18 Saturday, 12.05.18 2
Wednesday, 09.05.18 Saturday, 12.05.18 2
Thursday, 10.05.18 Saturday, 19.05.18 3
Friday, 11.05.18 Saturday, 19.05.18 3
Saturday, 12.05.18 Saturday, 19.05.18 3
Sunday, 13.05.18 Saturday, 19.05.18 3
Monday, 14.05.18 Saturday, 19.05.18 3
目标:如果今天和下周六之间的差异小于3,请在此之后使用星期六作为交付日期。如果今天和下周六之间的差异等于/大于3,请使用此星期六作为交货日期。在excel公式中:
=IF((delivery 1 - today) < 3, delivery date 2, delivery 1)
谢谢!