开发者

Tutorial for calendar-picker logic and/or a jQuery datepicker sans 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 recomm开发者_开发百科end 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?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜