【发布时间】:2015-04-04 14:09:42
【问题描述】:
我不知道如何使用该功能设置日期输入的选定日期(Popup Datepicker),并在下面的日历中设置该日期(Inline Datepicker)。我见过这个函数来设置它:_setDate,或者_setDateDatepicker,但是我不知道如何实现它。请,如果有人可以帮助我,我将不胜感激。
$.datepicker.setDefaults({
showOn: "both",
showWeek: true,
firstDay: 1,
dateFormat: 'dd/mm/yy',
maxDate: '+0',
selectOtherMonths: true,
regional: 'uk',
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
<body>
<h2>Popup Datepicker</h2>
<div data-demo-html="true">
<input type="date" id="date_val" data-role="datebox" style="margin-top: 10px" data-options='{"mode": "calbox", "useNewStyle":true,"useFocus": true}'>
</div>
Evento:
<input type="text" id="event" name="event">
<input type="button" id="btn" value=" Enviar " onClick="myFunction()">
<h2>Inline Datepicker</h2>
<div data-demo-html="true">
<input type="text" id="cal" data-role="date" data-inline="true">
</div>
【问题讨论】:
-
您找到解决方案了吗?我还需要实现
onSelect,但仍然没有任何线索。
标签: javascript jquery datepicker