问题描述
我想在下午2点以后更改一天。有人可以帮我吗?
解决方法
像这样-我假设星期五之后的14:00和星期三14:00之前的任何一天表示星期三交货
const dayNames = ["wednesday","wednesday","thursday","friday","friday"];
let now = new Date();
if (now.getHours() >= 14) now.setDate(now.getDate()+1)
document.write("Buy nowe,you geti it on " + dayNames[now.getDay()]);
<a id="orderBy"></a>
,
您可以将时间设置为从现在开始的14小时。因此,如果是下午2点或之后,则将在第二天及之后的12:00 am进行。
let shippingTime = new Date();
shippingTime.setHours(shippingTime.getHours() + 14);
document.write("Buy now,you get it on " + dayNames[shippingTime.getDay()]);
<a id="orderBy"></a>
,
尝试一下
No matching bindings found for serviceIdentifier: MyController