2013-11-26 09:58:34 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2013-12-04 14:16:19 +00:00
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
2013-11-27 19:28:25 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="./jquery.datetimepicker.css"/>
|
2013-11-26 09:58:34 +00:00
|
|
|
</head>
|
2013-11-03 10:35:38 +00:00
|
|
|
<body>
|
2013-11-27 19:50:42 +00:00
|
|
|
<p><a href="http://xdsoft.net/jqplugins/datetimepicker/">Homepage</a></p>
|
2013-11-07 04:24:58 +00:00
|
|
|
<h3>DateTimePicker</h3>
|
|
|
|
<input type="text" value="2014/03/15 05:06" id="datetimepicker"/><br><br>
|
2013-11-28 12:16:07 +00:00
|
|
|
<h3>Mask DateTimePicker</h3>
|
|
|
|
<input type="text" value="" id="datetimepicker_mask"/><br><br>
|
2013-11-07 04:24:58 +00:00
|
|
|
<h3>TimePicker</h3>
|
|
|
|
<input type="text" id="datetimepicker1"/><br><br>
|
|
|
|
<h3>DatePicker</h3>
|
|
|
|
<input type="text" id="datetimepicker2"/><br><br>
|
|
|
|
<h3>Inline DateTimePicker</h3>
|
2014-01-09 06:54:36 +00:00
|
|
|
<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>
|
2013-11-07 04:24:58 +00:00
|
|
|
<h3>Button Trigger</h3>
|
2013-12-24 11:59:06 +00:00
|
|
|
<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"/>
|
2013-11-15 06:47:44 +00:00
|
|
|
<h3>TimePicker allows time</h3>
|
|
|
|
<input type="text" id="datetimepicker5"/><br><br>
|
2013-11-19 09:20:05 +00:00
|
|
|
<h3>Destroy DateTimePicker</h3>
|
|
|
|
<input type="text" id="datetimepicker6"/><input id="destroy" type="button" value="destroy"/>
|
2013-12-05 14:42:51 +00:00
|
|
|
<h3>Set options runtime DateTimePicker</h3>
|
|
|
|
<input type="text" id="datetimepicker7"/>
|
|
|
|
<p>If select day is Saturday, the minimum set 11:00, otherwise 8:00</p>
|
2013-12-10 19:45:29 +00:00
|
|
|
<h3>onGenerate</h3>
|
|
|
|
<input type="text" id="datetimepicker8"/>
|
2013-12-16 03:51:07 +00:00
|
|
|
<h3>disable all weekend</h3>
|
|
|
|
<input type="text" id="datetimepicker9"/>
|
2014-01-12 18:02:26 +00:00
|
|
|
<h3>Show inline</h3>
|
|
|
|
<a href="javascript:var si = document.getElementById('show_inline').style; si.display = (si.display=='none')?'block':'none';return false; ">Show/Hide</a>
|
|
|
|
<div id="show_inline" style="display:none">
|
|
|
|
<input type="text" id="datetimepicker10"/>
|
|
|
|
</div>
|
2013-11-03 10:35:38 +00:00
|
|
|
</body>
|
2013-11-27 19:28:25 +00:00
|
|
|
<script src="./jquery.js"></script>
|
|
|
|
<script src="./jquery.datetimepicker.js"></script>
|
2013-11-03 10:35:38 +00:00
|
|
|
<script>
|
2014-01-12 18:02:26 +00:00
|
|
|
|
|
|
|
$('#datetimepicker10').datetimepicker({
|
|
|
|
step:5,
|
|
|
|
inline:true
|
2014-01-12 18:07:52 +00:00
|
|
|
});
|
|
|
|
$('#datetimepicker_mask').datetimepicker({
|
2013-11-28 12:16:07 +00:00
|
|
|
mask:'9999/19/39 29:59',
|
|
|
|
});
|
2013-11-03 10:35:38 +00:00
|
|
|
$('#datetimepicker').datetimepicker();
|
2013-12-12 09:43:03 +00:00
|
|
|
$('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10});
|
2013-11-03 10:35:38 +00:00
|
|
|
$('#datetimepicker1').datetimepicker({
|
|
|
|
datepicker:false,
|
|
|
|
format:'H:i',
|
2013-11-27 19:28:25 +00:00
|
|
|
step:5
|
2013-11-03 10:35:38 +00:00
|
|
|
});
|
|
|
|
$('#datetimepicker2').datetimepicker({
|
2014-01-09 08:21:23 +00:00
|
|
|
yearOffset:222,
|
|
|
|
lang:'th',
|
2013-11-03 10:35:38 +00:00
|
|
|
timepicker:false,
|
|
|
|
format:'d/m/Y',
|
2013-11-26 07:28:31 +00:00
|
|
|
formatDate:'Y/m/d',
|
|
|
|
minDate:'-1970/01/02', // yesterday is minimum date
|
2013-11-27 19:28:25 +00:00
|
|
|
maxDate:'+1970/01/02' // and tommorow is maximum date calendar
|
2013-11-03 10:35:38 +00:00
|
|
|
});
|
|
|
|
$('#datetimepicker3').datetimepicker({
|
2013-11-27 19:28:25 +00:00
|
|
|
inline:true
|
2013-11-03 10:35:38 +00:00
|
|
|
});
|
2013-11-07 04:24:58 +00:00
|
|
|
$('#datetimepicker4').datetimepicker();
|
|
|
|
$('#open').click(function(){
|
|
|
|
$('#datetimepicker4').datetimepicker('show');
|
|
|
|
});
|
|
|
|
$('#close').click(function(){
|
|
|
|
$('#datetimepicker4').datetimepicker('hide');
|
|
|
|
});
|
2013-12-24 11:59:06 +00:00
|
|
|
$('#reset').click(function(){
|
|
|
|
$('#datetimepicker4').datetimepicker('reset');
|
|
|
|
});
|
2013-11-15 06:47:44 +00:00
|
|
|
$('#datetimepicker5').datetimepicker({
|
|
|
|
datepicker:false,
|
2013-11-27 19:28:25 +00:00
|
|
|
allowTimes:['12:00','13:00','15:00','17:00','17:05','17:20','19:00','20:00']
|
2013-11-15 06:47:44 +00:00
|
|
|
});
|
2013-11-19 09:20:05 +00:00
|
|
|
$('#datetimepicker6').datetimepicker();
|
|
|
|
$('#destroy').click(function(){
|
|
|
|
if( $('#datetimepicker6').data('xdsoft_datetimepicker') ){
|
|
|
|
$('#datetimepicker6').datetimepicker('destroy');
|
|
|
|
this.value = 'create';
|
|
|
|
}else{
|
|
|
|
$('#datetimepicker6').datetimepicker();
|
|
|
|
this.value = 'destroy';
|
|
|
|
}
|
|
|
|
});
|
2013-12-05 14:42:51 +00:00
|
|
|
var logic = function( currentDateTime ){
|
|
|
|
if( currentDateTime.getDay()==6 ){
|
|
|
|
this.setOptions({
|
|
|
|
minTime:'11:00'
|
|
|
|
});
|
|
|
|
}else
|
|
|
|
this.setOptions({
|
|
|
|
minTime:'8:00'
|
|
|
|
});
|
|
|
|
};
|
|
|
|
$('#datetimepicker7').datetimepicker({
|
|
|
|
onChangeDateTime:logic,
|
|
|
|
onShow:logic
|
|
|
|
});
|
2013-12-10 19:45:29 +00:00
|
|
|
$('#datetimepicker8').datetimepicker({
|
|
|
|
onGenerate:function( ct ){
|
|
|
|
$(this).find('.xdsoft_date')
|
|
|
|
.toggleClass('xdsoft_disabled');
|
|
|
|
},
|
2013-12-10 19:49:39 +00:00
|
|
|
minDate:'-1970/01/2',
|
2013-12-10 19:45:29 +00:00
|
|
|
maxDate:'+1970/01/2',
|
|
|
|
timepicker:false
|
|
|
|
});
|
2013-12-16 03:51:07 +00:00
|
|
|
$('#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
|
2014-01-12 18:07:52 +00:00
|
|
|
});
|
2013-11-03 10:35:38 +00:00
|
|
|
</script>
|
|
|
|
</html>
|