mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Datepicker: Fix the eachDay
option
Use the `eachDay` option in the other-months demo. Fix handling of `extraClasses` property, split on space.
This commit is contained in:
parent
e50d6d3bd2
commit
9ec69ccb73
@ -17,8 +17,13 @@
|
|||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#datepicker" ).datepicker({
|
$( "#datepicker" ).datepicker({
|
||||||
showOtherMonths: true,
|
eachDay: function( day ) {
|
||||||
selectOtherMonths: true
|
if ( day.lead ) {
|
||||||
|
day.render = true;
|
||||||
|
day.selectable = true;
|
||||||
|
day.extraClasses = "ui-priority-secondary";
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
5
external/date.js
vendored
5
external/date.js
vendored
@ -130,8 +130,9 @@ $.date = function( datestring, formatstring ) {
|
|||||||
today: today.equal( printDate )
|
today: today.equal( printDate )
|
||||||
};
|
};
|
||||||
day.render = day.selectable = !day.lead;
|
day.render = day.selectable = !day.lead;
|
||||||
// TODO undefined in picker demos, fix it
|
if ( this.eachDay ) {
|
||||||
// this.eachDay( day );
|
this.eachDay( day );
|
||||||
|
}
|
||||||
// TODO use adjust("D", 1)?
|
// TODO use adjust("D", 1)?
|
||||||
printDate.setDate( printDate.getDate() + 1 );
|
printDate.setDate( printDate.getDate() + 1 );
|
||||||
}
|
}
|
||||||
|
@ -476,7 +476,7 @@ $.widget( "ui.datepicker", {
|
|||||||
classes.push( "ui-state-highlight" );
|
classes.push( "ui-state-highlight" );
|
||||||
}
|
}
|
||||||
if ( day.extraClasses ) {
|
if ( day.extraClasses ) {
|
||||||
classes.push( day.extraClasses.split( "" ) );
|
classes.push( day.extraClasses.split( " " ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
link = "<a href='#' tabindex='-1' data-timestamp='" + day.timestamp + "' class='" + classes.join( " " ) + "'>" +
|
link = "<a href='#' tabindex='-1' data-timestamp='" + day.timestamp + "' class='" + classes.join( " " ) + "'>" +
|
||||||
@ -495,7 +495,7 @@ $.widget( "ui.datepicker", {
|
|||||||
classes.push( "ui-state-highlight" );
|
classes.push( "ui-state-highlight" );
|
||||||
}
|
}
|
||||||
if ( day.extraClasses ) {
|
if ( day.extraClasses ) {
|
||||||
classes.push( day.extraClasses.split( "" ) );
|
classes.push( day.extraClasses.split( " " ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return "<span class='" + classes.join( "" ) + "'>" +
|
return "<span class='" + classes.join( "" ) + "'>" +
|
||||||
|
Loading…
Reference in New Issue
Block a user