jquery - How to change default highlighted "today" date in datepicker -
i'm using datepicker selecting dates in 2 date fields (from date , date).
in those, default highlighted date today date. need alter default highlighted date other day in sec datepicker. (as illustration today + 8 days).
how can correctly ?
following datepickers,
$(function() { $( "#datepicker" ).datepicker(); $( "#datepicker" ).datepicker("option", "dateformat", "yy-mm-dd"); // iso 8601 $( "#datepicker2" ).datepicker(); $( "#datepicker2" ).datepicker("option", "dateformat", "yy-mm-dd"); });
thanks.
---------------------------------- update -----------------------------------------------
following screen shot michael,
i set following,
$( "#datepicker2" ).datepicker("option", "defaultdate", +2);
you can see still 21 day (today) highlighting , 23 bordered black line. need see 23 looks 21 hi lighting. no need highlight 21.
$( "#datepicker" ).datepicker("option", "defaultdate", +8);
source: http://api.jqueryui.com/datepicker/#option-defaultdate
edit: current date highlighted part of datepicker. there no alternative turn off feature. create clear user "today" is. can override graphical appearance of w/ css:
.ui-datepicker-today a.ui-state-highlight { border-color: #d3d3d3; background: #e6e6e6 url(/themeroller/images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;; color: #555555; } .ui-datepicker-today.ui-datepicker-current-day a.ui-state-highlight { border-color: #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; color: #212121; }
working jsfiddle: http://jsfiddle.net/epwud/
this assumes you're using default theme - can same practice theme. override styles code above. css incomplete, however. you'll need create overrides other cases, :hover state.
jquery datepicker
No comments:
Post a Comment