基于 jQuery 的日期/时间选择器的建议

发布于 2024-09-05 01:24:14 字数 160 浏览 0 评论 0原文

我正在寻找一个基于 jQuery 的日期/时间选择器。我发现了一些非常好的,但我的要求之一是我可以提供可用日期/时间的 json/xml/etc 源,并且控件应该只允许选择可用日期/时间。

有谁知道有一个插件可以做到这一点,或者至少有一个可以修改来做到这一点的插件?

谢谢!

I'm in search for a jQuery-based Date/Time Selector. I have found a few that are quite nice, but one of my requirements is that I can provide a json/xml/etc source of available days/times and the control should only allow selections of available days/times.

Is anyone aware of a plugin that does this, or at least a plugin that could be modified to do this?

Thanks!

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

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

发布评论

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

评论(2

﹂绝世的画 2024-09-12 01:24:14

我将 jQuery UI 的日期选择器与 Martin Milesich 的插件结合使用。这是在日期选择旁边实现时间选择的一种奇妙方式。看起来该插件已离线,但我上传了脚本,因此您可以在此处下载:http://textsnip.com /19046f

这是屏幕截图:

替代文字

它很容易实现。只需从 jQuery UI 调用常规 datepicker() 方法并添加 showTime: true 参数即可。这是一个示例:

$('#sample').datepicker({
  duration: '',
  showTime: true,
  constrainInput: false,
  stepMinutes: 1,
  stepHours: 1,
  altTimeField: '',
  time24h: false
});

I use jQuery UI's datepicker in conjunction with a plugin from Martin Milesich. It's a fantastic way to implement timepicking right next to the datepicking. It looks like the plugin has gone offline, but I uploaded the script so you can download it here: http://textsnip.com/19046f

Here is a screenshot:

alt text

It's very easy to implement. Just call the regular datepicker() method from jQuery UI and add a showTime: true parameter. Here is a sample:

$('#sample').datepicker({
  duration: '',
  showTime: true,
  constrainInput: false,
  stepMinutes: 1,
  stepHours: 1,
  altTimeField: '',
  time24h: false
});
多孤肩上扛 2024-09-12 01:24:14

这个插件很不错,应该能满足你的要求。
http://keith-wood.name/datepickRef.html

通知 onDate 方法:它允许您控制每个特定日期的呈现,包括日期是否可选。

This plugin is pretty good and it should satisfy your requirements.
http://keith-wood.name/datepickRef.html

Notice onDate method: it allows you to control presentation of each particular date, including whether date is selectable or not.

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