mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
new version 2.0.9
fix plugin height added dblclick event for select date at timepicker visible
This commit is contained in:
parent
887c934142
commit
54523e849d
@ -20,7 +20,7 @@
|
||||
"jquery",
|
||||
"touch"
|
||||
],
|
||||
"version": "2.0.8",
|
||||
"version": "2.0.9",
|
||||
"author": {
|
||||
"name": "Chupurnov Valeriy",
|
||||
"email": "chupurnov@gmail.com",
|
||||
|
25
doc.tpl
25
doc.tpl
@ -315,6 +315,30 @@ $('#_datetimepicker_ongenerate').datetimepicker({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<hr id="weekends_disable"/>
|
||||
<h4>disable all weekend <a href="#weekends_disable">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">$('#datetimepicker9').datetimepicker({
|
||||
onGenerate:function( ct ){
|
||||
$(this).find('.xdsoft_date.xdsoft_weekend')
|
||||
.addClass('xdsoft_disabled');
|
||||
},
|
||||
weekends:['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'],
|
||||
timepicker:false
|
||||
});</code></pre>
|
||||
<p><strong>Result</strong></p>
|
||||
<p><input id="_datetimepicker_weekends_disable" type="text" value="" /></p>
|
||||
<script>$(function(){
|
||||
$('#_datetimepicker_weekends_disable').datetimepicker({
|
||||
onGenerate:function( ct ){
|
||||
$(this).find('.xdsoft_date.xdsoft_weekend')
|
||||
.addClass('xdsoft_disabled');
|
||||
},
|
||||
weekends:['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'],
|
||||
timepicker:false
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<h2>Full options list</h2>
|
||||
<table class="table table-condensed table-bordered table-striped">
|
||||
<thead>
|
||||
@ -567,6 +591,7 @@ $('#_datetimepicker_ongenerate').datetimepicker({
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr id="className"><td>className</td><td></td><td></td><td></td></tr>
|
||||
<tr id="weekends"><td><a href="#weekends">weekends</a></td><td>[]</td><td></td><td><pre><code data-language="javascript">['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014']</code></pre></td></tr>
|
||||
<tr id="id"><td>id</td><td></td><td></td><td></td></tr>
|
||||
<tr id="style"><td>style</td><td></td><td></td><td></td></tr>
|
||||
</tbody>
|
||||
|
@ -59,6 +59,7 @@
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{
|
||||
margin-top:8px;
|
||||
margin-bottom:3px
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_mounthpicker{
|
||||
position: relative;
|
||||
@ -214,6 +215,9 @@
|
||||
cursor:pointer;
|
||||
height: 25px;
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_calendar th{
|
||||
background: #F1F1F1;
|
||||
}
|
||||
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{
|
||||
color:#33AAFF;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @preserve jQuery DateTimePicker plugin v2.0.8
|
||||
* @preserve jQuery DateTimePicker plugin v2.0.9
|
||||
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
||||
* (c) 2013, Chupurnov Valeriy.
|
||||
*/
|
||||
@ -730,19 +730,22 @@
|
||||
timeboxparent.trigger('scroll_element.xdsoft_scroller',[parseInt(top)/(height-pheight)]);
|
||||
}
|
||||
});
|
||||
var timerclick = 0;
|
||||
calendar
|
||||
.on('mousedown.xdsoft','td',function() {
|
||||
.on('click.xdsoft','td',function() {
|
||||
timerclick++;
|
||||
var $this = $(this),
|
||||
currentTime = _xdsoft_datetime.currentTime;
|
||||
if( $this.hasClass('xdsoft_disabled') )
|
||||
return false;
|
||||
|
||||
currentTime.setFullYear( $this.data('year') );
|
||||
currentTime.setMonth( $this.data('month') );
|
||||
currentTime.setDate( $this.data('date') );
|
||||
datetimepicker.trigger('select.xdsoft',[currentTime]);
|
||||
|
||||
input.val( _xdsoft_datetime.str() );
|
||||
if( (options.closeOnDateSelect===true||( options.closeOnDateSelect===0&&!options.timepicker ))&&!options.inline ) {
|
||||
if( (timerclick>1||(options.closeOnDateSelect===true||( options.closeOnDateSelect===0&&!options.timepicker )))&&!options.inline ) {
|
||||
datetimepicker.trigger('close.xdsoft');
|
||||
}
|
||||
|
||||
@ -752,10 +755,13 @@
|
||||
|
||||
datetimepicker.trigger('xchange.xdsoft');
|
||||
datetimepicker.trigger('changedatetime.xdsoft');
|
||||
setTimeout(function(){
|
||||
timerclick = 0;
|
||||
},200);
|
||||
});
|
||||
|
||||
timebox
|
||||
.on('mousedown.xdsoft','div',function() {
|
||||
.on('click.xdsoft','div',function() {
|
||||
var $this = $(this),
|
||||
currentTime = _xdsoft_datetime.currentTime;
|
||||
if( $this.hasClass('xdsoft_disabled') )
|
||||
|
Loading…
Reference in New Issue
Block a user