new version 2.0.9

fix plugin height
added dblclick event for select date at timepicker visible
This commit is contained in:
Valeriy 2013-12-16 15:19:10 +06:00
parent 887c934142
commit 54523e849d
4 changed files with 41 additions and 6 deletions

View File

@ -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
View File

@ -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">$(&#39;#datetimepicker9&#39;).datetimepicker({
onGenerate:function( ct ){
$(this).find(&#39;.xdsoft_date.xdsoft_weekend&#39;)
.addClass('xdsoft_disabled');
},
weekends:[&#39;01.01.2014&#39;,&#39;02.01.2014&#39;,&#39;03.01.2014&#39;,&#39;04.01.2014&#39;,&#39;05.01.2014&#39;,&#39;06.01.2014&#39;],
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>&nbsp;</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">[&#39;01.01.2014&#39;,&#39;02.01.2014&#39;,&#39;03.01.2014&#39;,&#39;04.01.2014&#39;,&#39;05.01.2014&#39;,&#39;06.01.2014&#39;]</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>

View File

@ -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;
}

View File

@ -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') )