带有阻止日期的日历/日期选择器
我目前正在开发一个订单系统,用户可以选择他们希望订单交付的日期。
我需要一个页面,其中日历/日期选择器始终可见(不是通过弹出窗口激活),并且所有过去的日期、今天的日期和未来 3 天的日期都被屏蔽。然后,用户可以从可用日期中进行选择,然后将其提交给客户。
任何帮助将不胜感激!
I am currently developing an order system where the user can select which day they would like their order to be delivered.
I need to have a page where a calendar/datepicker is visible (not activated by popup) at all times and has all past dates, todays date and 3 days into the future blocked out. The user can then select from the dates available which is then submitted to the client.
Any assistance would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
检查以下链接:
http://jqueryui.com/demos/datepicker/#inline
http://jqueryui.com/demos/datepicker/#min-max
描述说:
“将开始日期和结束日期设置为实际日期 (new Date(2009, 1 - 1, 26))、作为距今天的数字偏移量 (-20) 或作为周期和单位的字符串('+1M +10D')"
Check the following links:
http://jqueryui.com/demos/datepicker/#inline
http://jqueryui.com/demos/datepicker/#min-max
The description says this:
"Set the beginning and end dates as actual dates (new Date(2009, 1 - 1, 26)), as a numeric offset from today (-20), or as a string of periods and units ('+1M +10D')"
请参阅
minDate 和 maxDate
See
minDate
andmaxDate
以下是如何始终显示日历的示例:
http://jqueryui.com/demos/datepicker/ #inline
看起来blackout-date功能可以通过beforeShowDay回调来实现,或者通过简单地设置日历最小/最大来实现。
http://jqueryui.com/demos/datepicker/#min-max
http://forum.jquery.com/topic/custom-callback-to-disable-specific-dates-in-datepicker
Here is an example of how to always display the calendar:
http://jqueryui.com/demos/datepicker/#inline
It looks like the blackout-date feature can be achieved through the beforeShowDay callback, or by simply setting the calendar min/max.
http://jqueryui.com/demos/datepicker/#min-max
http://forum.jquery.com/topic/custom-callback-to-disable-specific-dates-in-datepicker
它可以通过两种类型来完成:
beforeShowDay
,您可以检查每个日期在该函数中使用日期范围数组或对象并返回 true 或 false。如果返回 false,则该日期将处于非活动状态,如果返回 true,则该日期将处于活动状态it can be done by two types
beforeShowDay
with each date on that month and year, and you can check for each date in that function with your date range array or object and return true or false. If false return that date will be deactive and on true that date will be active