mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
new version 2.1.4
Fix bug with setOptions({value:'2011/12/11 12:00'})
This commit is contained in:
parent
e22f12f2a8
commit
0df3b7e420
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name":"datetimepicker",
|
||||
"version":"2.1.3",
|
||||
"version":"2.1.4",
|
||||
"main": [
|
||||
"jquery.datetimepicker.js",
|
||||
"jquery.datetimepicker.css"
|
||||
|
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "datetimepicker",
|
||||
"title": "jQuery Date and Time picker",
|
||||
"version": "2.1.4",
|
||||
"title": "jQuery Date and Time picker",
|
||||
"description": "jQuery plugin for date, time, or datetime manipulation in form",
|
||||
"keywords": [
|
||||
"calendar",
|
||||
@ -20,7 +21,6 @@
|
||||
"jquery",
|
||||
"touch"
|
||||
],
|
||||
"version": "2.1.3",
|
||||
"author": {
|
||||
"name": "Chupurnov Valeriy",
|
||||
"email": "chupurnov@gmail.com",
|
||||
|
49
doc.tpl
49
doc.tpl
@ -339,6 +339,55 @@ $('#_datetimepicker_weekends_disable').datetimepicker({
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<hr id="range"/>
|
||||
<h4>Range between date<a href="#range">#</a></h4>
|
||||
<p><strong>javaScript</strong></p>
|
||||
<pre><code data-language="javascript">$(function(){
|
||||
$('#date_timepicker_start').datetimepicker({
|
||||
format:'Y/m/d',
|
||||
onShow:function( ct ){
|
||||
this.setOptions({
|
||||
maxDate:$('#date_timepicker_end').val()?$('#date_timepicker_end').val():false
|
||||
})
|
||||
},
|
||||
timepicker:false
|
||||
});
|
||||
$('#date_timepicker_end').datetimepicker({
|
||||
format:'Y/m/d',
|
||||
onShow:function( ct ){
|
||||
this.setOptions({
|
||||
minDate:$('#date_timepicker_start').val()?$('#date_timepicker_start').val():false
|
||||
})
|
||||
},
|
||||
timepicker:false
|
||||
});
|
||||
});</code></pre>
|
||||
<p><strong>Result</strong></p>
|
||||
<p>
|
||||
Start <input id="date_timepicker_start" type="text" value="" placeholder="start" />
|
||||
End <input id="date_timepicker_end" type="text" value="" placeholder="end" />
|
||||
</p>
|
||||
<script>$(function(){
|
||||
$('#date_timepicker_start').datetimepicker({
|
||||
format:'Y/m/d',
|
||||
onShow:function( ct ){
|
||||
this.setOptions({
|
||||
maxDate:$('#date_timepicker_end').val()?$('#date_timepicker_end').val():false
|
||||
})
|
||||
},
|
||||
timepicker:false
|
||||
});
|
||||
$('#date_timepicker_end').datetimepicker({
|
||||
format:'Y/m/d',
|
||||
onShow:function( ct ){
|
||||
this.setOptions({
|
||||
minDate:$('#date_timepicker_start').val()?$('#date_timepicker_start').val():false
|
||||
})
|
||||
},
|
||||
timepicker:false
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<h2>Full options list</h2>
|
||||
<table class="table table-condensed table-bordered table-striped">
|
||||
<thead>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<h3>DatePicker</h3>
|
||||
<input type="text" id="datetimepicker2"/><br><br>
|
||||
<h3>Inline DateTimePicker</h3>
|
||||
<input type="text" id="datetimepicker3"/><br><br>
|
||||
<input type="text" id="datetimepicker3"/><input type="button" onclick="$('#datetimepicker3').datetimepicker({value:'2011/12/11 12:00'})" value="set inline value 2011/12/11 12:00"/><br><br>
|
||||
<h3>Button Trigger</h3>
|
||||
<input type="text" value="2013/12/03 18:00" id="datetimepicker4"/><input id="open" type="button" value="open"/><input id="close" type="button" value="close"/><input id="reset" type="button" value="reset"/>
|
||||
<h3>TimePicker allows time</h3>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @preserve jQuery DateTimePicker plugin v2.1.3
|
||||
* @preserve jQuery DateTimePicker plugin v2.1.4
|
||||
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
|
||||
* (c) 2013, Chupurnov Valeriy.
|
||||
*/
|
||||
@ -323,8 +323,10 @@
|
||||
if( options.datepicker && !options.timepicker )
|
||||
timepicker.removeClass('active');
|
||||
|
||||
if( options.value )
|
||||
if( options.value ){
|
||||
input&&input.val&&input.val(options.value);
|
||||
_xdsoft_datetime.setCurrentTime(options.value);
|
||||
}
|
||||
|
||||
if( isNaN(options.dayOfWeekStart)||parseInt(options.dayOfWeekStart)<0||parseInt(options.dayOfWeekStart)>6 )
|
||||
options.dayOfWeekStart = 0;
|
||||
@ -501,7 +503,7 @@
|
||||
|
||||
$('body').append(datetimepicker);
|
||||
|
||||
var XDSoftDateTime = function() {
|
||||
var _xdsoft_datetime = new function() {
|
||||
var _this = this;
|
||||
_this.now = function() {
|
||||
return new Date();
|
||||
@ -575,8 +577,7 @@
|
||||
_this.str = function() {
|
||||
return _this.currentTime.dateFormat(options.format);
|
||||
};
|
||||
},
|
||||
_xdsoft_datetime = new XDSoftDateTime;
|
||||
};
|
||||
mounth_picker
|
||||
.find('.xdsoft_today_button')
|
||||
.on('mousedown.xdsoft',function() {
|
||||
|
Loading…
Reference in New Issue
Block a user