Fix list issue

This commit is contained in:
Valeriy 2014-06-30 17:45:25 +06:00
commit 3110364005
4 changed files with 176 additions and 161 deletions

View File

@ -1,6 +1,6 @@
{
"name":"datetimepicker",
"version":"2.2.9",
"version":"2.3.0",
"main": [
"jquery.datetimepicker.js",
"jquery.datetimepicker.css"

View File

@ -1,6 +1,6 @@
{
"name": "datetimepicker",
"version": "2.2.9",
"version": "2.3.0",
"title": "jQuery Date and Time picker",
"description": "jQuery plugin for date, time, or datetime manipulation in form",
"keywords": [

View File

@ -3,6 +3,13 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="./jquery.datetimepicker.css"/>
<style type="text/css">
.custom-date-style {
background-color: red !important;
}
</style>
</head>
<body>
<p><a href="http://xdsoft.net/jqplugins/datetimepicker/">Homepage</a></p>
@ -34,23 +41,26 @@
<div id="show_inline" style="display:none">
<input type="text" id="datetimepicker10"/>
</div>
<h3>Date Time Picker start time</h3>
<input type="text" id="datetimepicker_start_time"/>
<h3>Date Time Picker from unixtime</h3>
<input type="text" id="datetimepicker_unixtime"/>
<h3>Date Time Picker with day of year and week of year</h3>
<h3>Disable Specific Dates</h3>
<p>Disable the dates 2 days from now.</p>
<input type="text" id="datetimepicker11"/>
<h3>Custom Date Styling</h3>
<p>Make the background of the date 2 days from now bright red.</p>
<input type="text" id="datetimepicker12"/>
</body>
<script type="text/javascript" src="./jquery.js"></script>
<script type="text/javascript" src="./jquery.datetimepicker.js"></script>
<script type="text/javascript">
$('#datetimepicker').datetimepicker()
.datetimepicker({value:'2015/04/15 05:03',step:10});
<script src="./jquery.js"></script>
<script src="./jquery.datetimepicker.js"></script>
<script>
$('#datetimepicker10').datetimepicker({
step:5,
inline:true
});
$('#datetimepicker_mask').datetimepicker({
mask:'9999/19/39 29:59'
});
$('#datetimepicker').datetimepicker();
$('#datetimepicker').datetimepicker({value:'2015/04/15 05:03',step:10});
$('#datetimepicker1').datetimepicker({
datepicker:false,
format:'H:i',
@ -80,7 +90,8 @@ $('#reset').click(function(){
});
$('#datetimepicker5').datetimepicker({
datepicker:false,
allowTimes:['12:00','13:00','15:00','17:00','17:05','17:20','19:00','20:00']
allowTimes:['12:00','13:00','15:00','17:00','17:05','17:20','19:00','20:00'],
step:5
});
$('#datetimepicker6').datetimepicker();
$('#destroy').click(function(){
@ -93,16 +104,14 @@ $('#destroy').click(function(){
}
});
var logic = function( currentDateTime ){
if( currentDateTime ){
if( currentDateTime.getDay()==6 ){
this.setOptions({
minTime:'11:00'
});
}else
this.setOptions({
minTime:'8:00'
});
}
if( currentDateTime.getDay()==6 ){
this.setOptions({
minTime:'11:00'
});
}else
this.setOptions({
minTime:'8:00'
});
};
$('#datetimepicker7').datetimepicker({
onChangeDateTime:logic,
@ -125,28 +134,25 @@ $('#datetimepicker9').datetimepicker({
weekends:['01.01.2014','02.01.2014','03.01.2014','04.01.2014','05.01.2014','06.01.2014'],
timepicker:false
});
$('#datetimepicker10').datetimepicker({
step:5,
inline:true
});
$('#datetimepicker_start_time').datetimepicker({
startDate:'+1970/05/01'
});
$('#datetimepicker_unixtime').datetimepicker({
format:'unixtime'
});
var dateToDisable = new Date();
dateToDisable.setDate(dateToDisable.getDate() + 2);
$('#datetimepicker11').datetimepicker({
hours12: false,
format: 'Y-z H:i W',
step: 1,
opened: false,
validateOnBlur: false,
closeOnDateSelect: false,
closeOnTimeSelect: false
beforeShowDay: function(date) {
if (date.getMonth() == dateToDisable.getMonth() && date.getDate() == dateToDisable.getDate()) {
return [false, ""]
}
return [true, ""];
}
});
$('#datetimepicker12').datetimepicker({
beforeShowDay: function(date) {
if (date.getMonth() == dateToDisable.getMonth() && date.getDate() == dateToDisable.getDate()) {
return [true, "custom-date-style"];
}
return [true, ""];
}
});
</script>
</html>

View File

@ -1,5 +1,5 @@
/**
* @preserve jQuery DateTimePicker plugin v2.2.9
* @preserve jQuery DateTimePicker plugin v2.3.0
* @homepage http://xdsoft.net/jqplugins/datetimepicker/
* (c) 2014, Chupurnov Valeriy.
*/
@ -272,7 +272,8 @@
className:'',
weekends : [],
yearOffset:0
yearOffset:0,
beforeShowDay: null
};
// fix for ie8
@ -936,7 +937,7 @@
minDate = new Date(minDate.getFullYear(),minDate.getMonth(),minDate.getDate());
}
var d,y,m,classes = [];
var d,y,m,classes = [],customDateSettings;
while( i<_xdsoft_datetime.currentTime.countDaysInMonth()||start.getDay()!=options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()==start.getMonth() ) {
classes = [];
@ -946,14 +947,22 @@
classes.push('xdsoft_date');
if( ( maxDate!==false && start > maxDate )||( minDate!==false && start < minDate ) ){
if ( options.beforeShowDay && options.beforeShowDay.call ) {
customDateSettings = options.beforeShowDay.call(datetimepicker, start);
} else {
customDateSettings = null;
}
if( ( maxDate!==false && start > maxDate )||( minDate!==false && start < minDate )||(customDateSettings && customDateSettings[0] === false) ){
classes.push('xdsoft_disabled');
}
if( _xdsoft_datetime.currentTime.getMonth()!=m ){
classes.push('xdsoft_other_month');
if ( customDateSettings && customDateSettings[1] != "" ) {
classes.push(customDateSettings[1]);
}
if( _xdsoft_datetime.currentTime.getMonth()!=m ) classes.push('xdsoft_other_month');
if( (options.defaultSelect||datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat( options.formatDate )==start.dateFormat( options.formatDate ) ) {
classes.push('xdsoft_current');
}