TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: A simple, customizable, lightweight (3.5KB) date picker for jQuery

9 点作者 gautaml将近 14 年前
Hi All,<p>I know there are plenty of date pickers out there, and I've tried/looked at quite a few however they were all either bloated or didn't quite have the features I needed for a site I'm working on.<p>Plus I needed an excuse to learn to write jQuery plugins and learn a few things along the way. :)<p>Some details and features about the plugin:<p>- lightweight (3.5KB compressed JS and 1KB compressed CSS)<p>- forward and back navigation<p>- current date highlight<p>- restricting selection of dates outside of a range<p>- restricting selection of dates beyond N-days from start date<p>- restricting forward / backwards month navigation<p>- individual styles per date picker (in case you have multiples on one page)<p>Downloads, examples, and instructions available at: http://code.gautamlad.com/glDatePicker/<p>Complete project source available at: https://github.com/glad/glDatePicker/<p>Appreciate all criticism and suggestion on the code.<p>Enjoy! :)

5 条评论

MattBearman将近 14 年前
Looks good, I like how simple the default UI is. A couple if issues I found (Google Chrome on Win XP):<p>- The first time you click the next arrow the datepicker closes and opens again.<p>- Unselectable dates have the loading (hourglass) mouse pointer, not sure if that's deliberate, it feels wrong.<p>Overall I think its a great first time jQuery plugin.
SHOwnsYou将近 14 年前
It sounds awesome - small, customizable datepicker, but nothing shows up for me in chrome for Mac.
评论 #2842240 未加载
gautaml将近 14 年前
Matt,<p>Thanks for the feedback.<p>The first comment, it was actually a bug that I noticed last night and fixed it. The reason it did that was because I put in a .blur() event on the input and when you try to click the Next/Prev, the focus being lost would cause it to hide. I think it should be fine now after fixing it.<p>Yes the "wait" cursor was deliberate although it's easily controlled by changing the .gldp-XXX-noday style to not have cursor:wait (where XXX is whatever you name your style)
gautaml将近 14 年前
Version 1.1 is out.<p>Fixed a major issue with the last date being incorrectly set if it was selected.<p>Also added an option to set the currently selected date either as a date or an offset from start date. The selected date is also shown in the calendar with a different style.
gautaml将近 14 年前
Links:<p><a href="http://code.gautamlad.com/glDatePicker/" rel="nofollow">http://code.gautamlad.com/glDatePicker/</a><p><a href="https://github.com/glad/glDatePicker/" rel="nofollow">https://github.com/glad/glDatePicker/</a>