jQuery Datepicker - 设置帮助

发布于 2024-10-10 14:36:01 字数 158 浏览 0 评论 0原文

我正在使用 jQuery Datepicker 插件,但在纠正这个独特的规则时遇到了麻烦。

我需要一条规则来验证今天中午 12:00 后是否禁用。

这应该在当前 AEST 时间进行验证。

添加 jquery validate 并使用它进行验证会更容易吗?

I am using the jQuery Datepicker plugin and I'm having trouble righting out this unique rule.

I need a rule that validates if after 12:00pm disable today

This should be validated on the current AEST time.

Would it be easier to add jquery validate and use that for the validation instead?

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

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

发布评论

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

评论(1

︶葆Ⅱㄣ 2024-10-17 14:36:01
// get today's date
var myDate = new Date();
// add one day
myDate.setDate(myDate.getDate()+1);

// bind datepicker to element while using the minDate option
$('.selector').datepicker({
    minDate: myDate
});

这会将日期选择器范围设置为今天日期之后的任意一天。但是,您仍然应该验证客户端和服务器端。

如果这就是您要查找的内容,请选中该答案旁边的复选标记。谢谢!

// get today's date
var myDate = new Date();
// add one day
myDate.setDate(myDate.getDate()+1);

// bind datepicker to element while using the minDate option
$('.selector').datepicker({
    minDate: myDate
});

This will set the date picker range to any day after today's date. You should still validate client and server side however.

If this is what you are looking for, please select the check mark next to this answer. Thanks!

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