Javascript / Jquery 日期倒计时

发布于 2024-10-03 08:13:28 字数 454 浏览 0 评论 0原文

谁能帮我做一个 javascript 倒计时吗?

例如:如果是周日下午 1:05,则会显示: “在接下来的 1 天 2 小时 55 分钟内下订单,您的订单将于周一发货” 另一个例子:如果是星期六下午 2:00,它会说: “在接下来的 2 小时内下订单,您的订单将在今天发货”

如果需要,我需要能够将截止点更改为下午 4 点...

它还必须忽略银行假日(理想情况下,它会在我可以在其中放置所有“排除”日期的代码,例如 12/25/2009、01/01/2010 等 - 这样我就可以保持最新状态)。 代码必须考虑到我们只在周一至周五发货(因此周五下午 4 点后,不会说明天发货,而是周一发货)。 一旦截止日期到来(下午 4 点),倒计时就会跳回以适应明天的截止日期,依此类推。 亚马逊做了一个非常类似的事情,但我无法弄清楚发生了什么

如果你能提供帮助 - 我们将不胜感激。我的网站上有 Jquery 框架,如果有帮助的话......

Could anyone help me with a javascript countdown;

For Example: If it's 1:05pm on Sunday, it would say:
"Place your order within the next 1 day 2 hours 55 minutes and your order will ship Monday"
Another example: If it's 2:00pm on Saturday, it would say:
"Place your order within the next 2 hours and your order will ship today"

I need to be able to change the cut off point from 4pm if needed...

It must also ignore bank holiday (Ideally, it would have a section in the code where I could put all 'excluded' dates, e.g. 12/25/2009, 01/01/2010, etc. - This way I could keep it up to date).
The code must take into account that we only deliver Monday to Friday (Therefore on a Friday after 4pm, it would not say delivery tomorrow, but Monday).
Once the deadline hits (4pm), the countdown jumps back up to accommodate tomorrow's deadline, etc.
Amazon does a very similar thing, but I can't suss out what's going on

If you could help - it'd be appreciated. I've got the Jquery framework on my site if that helps...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑色毁心梦 2024-10-10 08:13:28

在这里您可以找到您的问题的示例,这可能对您有帮助 http://keith-wood.name /倒计时.html

Here you can find a example for your question, This may be helpful for you http://keith-wood.name/countdown.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文