What's a Good Javascript Time Picker? [closed]

2019-01-21 01:29发布

What's a good time picker for jquery or standalone js? I would like something like google uses in their calendar where it has a drop down of common times in 15min intervals or lets you manually type in a time and it validates it.

11条回答
再贱就再见
2楼-- · 2019-01-21 01:31

CSS Gallery has variety of Time Pickers. Have a look.

Perifer Design's time picker is similar to google one

查看更多
太酷不给撩
3楼-- · 2019-01-21 01:32

Sorry guys.. maybe it's a bit late.. I've been using NoGray.. it's cool..

查看更多
混吃等死
4楼-- · 2019-01-21 01:33

I've been using ClockPick.

查看更多
孤傲高冷的网名
5楼-- · 2019-01-21 01:35

You could read jQuery creator John Resig's post about it here: http://ejohn.org/blog/picking-time/.

查看更多
Luminary・发光体
6楼-- · 2019-01-21 01:36

Here is one that works with Twitter Bootstrap.

http://jdewit.github.com/bootstrap-timepicker/

查看更多
一夜七次
7楼-- · 2019-01-21 01:40

I wasn't happy with any of the suggested time pickers, so I created my own with inspiration from Perifer's and the HTML5 spec:

http://github.com/gregersrygg/jquery.timeInput

You can either use the new html5 attributes for time input (step, min, max), or use an options object:

<input type="time" name="myTime" class="time-mm-hh" min="9:00" max="18:00" step="1800" />
<input type="time" name="myTime2" class="time-mm-hh" />

<script type="text/javascript">
    $("input[name='myTime']").timeInput(); // use default or html5 attributes
    $("input[name='myTime2']").timeInput({min: "6:00", max: "15:00", step: 900}); // 15 min intervals from 6:00 am to 3:00 pm
</script>

Validates input like this:

  • Insert ":" if missing
  • Not valid time? Replace with blank
  • Not a valid time according to step? Round up/down to closest step

The HTML5 spec doesn't allow am/pm or localized time syntax, so it only allowes the format hh:mm. Seconds is allowed according to spec, but I have not implemented it yet.

It's very "alpha", so there might be some bugs. Feel free to send me patches/pull requests. Have manually tested in IE 6&8, FF, Chrome and Opera (Latest stable on Linux for the latter ones).

查看更多
登录 后发表回答