php 简单的类似 DatePicker 的日历
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4332379/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Simple DatePicker-like Calendar
提问by abalone
Can anyone recommend a simple datepicker calendar that I can use for a blog to link to different urls rather than for a form? jquery or css based would be good. When clicking next/prev month I don't want it reload page.
任何人都可以推荐一个简单的日期选择器日历,我可以将其用于博客以链接到不同的网址而不是表单?基于 jquery 或 css 会很好。单击下个月/上个月时,我不希望它重新加载页面。
回答by Breezer
jquery ui has a great datepicker you can find it here
jquery ui 有一个很棒的日期选择器,你可以在这里找到它
http://jqueryui.com/demos/datepicker/
http://jqueryui.com/demos/datepicker/
you can use
您可以使用
http://jqueryui.com/demos/datepicker/#event-onSelect
http://jqueryui.com/demos/datepicker/#event-onSelect
to make your own actions when a date is picked
在选择日期时做出自己的行动
and if you want it to open without a form you could create a form that's hidden and then bind a click event to it like this
如果您希望它在没有表单的情况下打开,您可以创建一个隐藏的表单,然后像这样将点击事件绑定到它
$("button").click(function() {
$(inputselector).datepicker('show');
});
回答by Neeraj Dhekale
No need to include JQuery or any other third party library.
无需包含 JQuery 或任何其他第三方库。
Specify your input date format in title tag.
在标题标签中指定您的输入日期格式。
HTML:
HTML:
<script type="text/javascript" src="http://services.iperfect.net/js/IP_generalLib.js">
Body
身体
<input type="text" name="date1" id="date1" alt="date" class="IP_calendar" title="d/m/Y">
回答by Brandon Durham
I'm particularly fond of this date picker built for Mootools: http://electricprism.com/aeron/calendar/
我特别喜欢这个为 Mootools 构建的日期选择器:http: //electricprism.com/aeron/calendar/
It's lovely right out of the box.
开箱即用很可爱。
回答by Bat_Programmer
How about the Dijit Calendar from the Dojo framework? It's pretty cool and very easy to implement. I always use this calendar.
https://www.dojotoolkit.org/reference-guide/dijit/Calendar.html
Dojo 框架中的 Dijit Calendar 怎么样?它非常酷而且很容易实现。我总是用这个日历。
https://www.dojotoolkit.org/reference-guide/dijit/Calendar.html
回答by admoghal
Here is the MooTools date picker
这是 MooTools 日期选择器
http://www.monkeyphysics.com/mootools/script/2/datepickerExample http://www.monkeyphysics.com/mootools/script/2/datepicker#examples
http://www.monkeyphysics.com/mootools/script/2/datepicker示例 http://www.monkeyphysics.com/mootools/script/2/datepicker#examples
回答by tony gil
this datepickeris an excellent solution. datepickers are a must if you want to avoid code injection.
这个日期选择器是一个很好的解决方案。如果你想避免代码注入,日期选择器是必须的。
回答by Karthik
Use amsul datepicker Package. for step by step integration http://phpnotebook.com/index.php/95-laravel/109-how-to-integrate-datepicker-in-laravel-5
使用 amsul datepicker 包。逐步集成http://phpnotebook.com/index.php/95-laravel/109-how-to-integrate-datepicker-in-laravel-5
回答by Chinmayee G
jQuery datepicker
is good option
jQuery datepicker
是个不错的选择