Create several datetimepickers with class selector

Fixes Issue #201 by moving _xdsoft_datetime declaration from
$.fn.datetimepicker() down into its createDateTimePicker()

With this fix, the next/prev month arrows work in all datetimepickers,
and not just the last.
This commit is contained in:
Bob Mazanec 2014-12-24 11:17:11 -06:00
parent 6dab89f4da
commit 7c645e58d0
2 changed files with 7 additions and 2 deletions

View File

@ -16,6 +16,9 @@
<p><a href="http://xdsoft.net/jqplugins/datetimepicker/">Homepage</a></p> <p><a href="http://xdsoft.net/jqplugins/datetimepicker/">Homepage</a></p>
<h3>DateTimePicker</h3> <h3>DateTimePicker</h3>
<input type="text" value="" id="datetimepicker"/><br><br> <input type="text" value="" id="datetimepicker"/><br><br>
<h3>DateTimePickers selected by class</h3>
<input type="text" class="some_class" value="" id="some_class_1"/>
<input type="text" class="some_class" value="" id="some_class_2"/>
<h3>Mask DateTimePicker</h3> <h3>Mask DateTimePicker</h3>
<input type="text" value="" id="datetimepicker_mask"/><br><br> <input type="text" value="" id="datetimepicker_mask"/><br><br>
<h3>TimePicker</h3> <h3>TimePicker</h3>
@ -69,6 +72,8 @@ startDate: '1986/01/05'
}); });
$('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10}); $('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10});
$('.some_class').datetimepicker();
$('#default_datetimepicker').datetimepicker({ $('#default_datetimepicker').datetimepicker({
formatTime:'H:i', formatTime:'H:i',
formatDate:'d.m.Y', formatDate:'d.m.Y',

View File

@ -690,7 +690,6 @@
lazyInitTimer = 0, lazyInitTimer = 0,
createDateTimePicker, createDateTimePicker,
destroyDateTimePicker, destroyDateTimePicker,
_xdsoft_datetime,
lazyInit = function (input) { lazyInit = function (input) {
input input
@ -735,7 +734,8 @@
current_time_index, current_time_index,
setPos, setPos,
timer = 0, timer = 0,
timer1 = 0; timer1 = 0,
_xdsoft_datetime;
mounth_picker mounth_picker
.find('.xdsoft_month span') .find('.xdsoft_month span')