日历选择器逻辑和/或 jQuery 日期选择器无 UI 的教程?
我正在为我们的应用程序构建一个日期选择器。我们正在使用 jQuery,因此 jQuery UI 将是典型的选项,只需使用它,但我们不会使用该产品加载 UI 库,因为它是移动的(因此我们试图保持带宽尽可能小) )加上我们正在构建的几乎所有小部件都是非典型的(对于大多数小部件,我们在 jQuery 中自己构建它们而不是修改 jQuery UI 会更容易且代码更少)。
我的问题由两部分组成:
1)任何人都可以推荐一个涵盖日期选择器逻辑的高级概念的教程吗?我可以找到很多示例 JS 日期选择器,但如果能够真正理解确定哪些日期属于哪一年的哪一天以生成日历本身所涉及的逻辑,那就太好了。
2)我确信,更明智的方法是修改现有的日期选择器插件。问题是我发现的那些都已被弃用(感谢 jQuery UI)。有谁知道一个积极开发的 jQuery Datepicker 插件,不依赖于 jQuery UI?
I'm building a datepicker for our application. We are using jQuery, so jQuery UI would be the typical option and just use that, but we're not going to be loading the UI library with this product as it's mobile (so we're trying to keep our bandwidth as small as possible) plus nearly all of the widgets we are building are atypical (for most widgets, it'll be easier and less code for us to build them ourselves in jQuery rather than modifying jQuery UI).
My two part question:
1) Can anyone recommend a tutorial that goes over the high-level concepts of the date picker logic? I can find lots of sample JS date pickers, but it'd be great to actually understand the logic involved in determining which dates fall on which days on which year to generate the calendar itself.
2) A more sane approach, I'm sure, is to modify an existing date picker plugin. The catch is that the one's I've found are all deprecated (thanks to jQuery UI). Does anyone know of an actively developed jQuery Datepicker plugin that isn't relying on jQuery UI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最喜欢的 jQuery Datepicker 是由 Kelvin Luck 开发的。它不需要 jQuery UI。
由于您要使用移动设备,请密切关注 HTML5 浏览器对内置浏览器的支持进展情况在日期选择器中。许多 HTML5 功能似乎首先出现在移动版本的浏览器中。
My favorite jQuery Datepicker is by Kelvin Luck. It does not require jQuery UI.
Since you're going mobile, keep an eye on the progress of HTML5 browser support for a built-in date picker. A lot of HTML5 features seem to appear first in the mobile versions of the browsers.
我听到你在说什么,但忍不住想问 jQuery UI 的日期选择器出了什么问题。您可以转到 存储库中的 jQuery UI 日期选择器文件,并在 jQuery UI 框架的其余部分的上下文之外查看日期选择器。然后你就可以从那里开始工作,它确实是最好的日期选择器之一。
至于替代方案,您始终可以尝试获得 YUI 等效项: http://yuilibrary.com/projects/yui3 /日历
I hear what you're saying, but can't help asking what's wrong with jQuery UI's datepicker. You can go to jQuery UI's datepicker file in the repository and see the datepicker outside the context of the rest of the jQuery UI framework. Then you can work from there, it's really one of the best datepickers available.
As for alternatives, you can always try to get the YUI equivalent: http://yuilibrary.com/projects/yui3/calendar