code_junkie

JQuery DatePicker, how to highlight current input value date

Nov 13th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. $('.date_picker').datepicker({ dateFormat: 'dd/mm/yy', duration: '', gotoCurrent: true, defaultDate: -1});
  2.  
  3. /*datepicker*/
  4. /* Main Style Sheet for jQuery UI date picker */
  5. .ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div {
  6. /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
  7. font-family: Verdana, Arial, sans-serif;
  8. background: #ffffff url(images/ffffff_40x100_textures_01_flat_0.png) 0 0 repeat-x;
  9. font-size: 0.80em;
  10. border: 4px solid #dddddd;
  11. width: 15.5em;
  12. padding: 2.5em .5em .5em .5em;
  13. position: relative;
  14. }
  15. .ui-datepicker-div, #ui-datepicker-div {
  16. z-index: 9999; /*must have*/
  17. display: none;
  18. }
  19. .ui-datepicker-inline {
  20. float: left;
  21. display: block;
  22. }
  23. .ui-datepicker-control {
  24. display: none;
  25. }
  26. .ui-datepicker-current {
  27. display: none;
  28. }
  29. .ui-datepicker-next, .ui-datepicker-prev {
  30. position: absolute;
  31. left: .5em;
  32. top: .5em;
  33. background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
  34. }
  35. .ui-datepicker-next {
  36. left: 14.6em;
  37. }
  38. .ui-datepicker-next:hover, .ui-datepicker-prev:hover {
  39. background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
  40. }
  41. .ui-datepicker-next a, .ui-datepicker-prev a {
  42. text-indent: -999999px;
  43. width: 1.3em;
  44. height: 1.4em;
  45. display: block;
  46. font-size: 1em;
  47. background: url(images/888888_7x7_arrow_left.gif) 50% 50% no-repeat;
  48. border: 1px solid #d3d3d3;
  49. cursor: pointer;
  50. }
  51. .ui-datepicker-next a {
  52. background: url(images/888888_7x7_arrow_right.gif) 50% 50% no-repeat;
  53. }
  54. .ui-datepicker-prev a:hover {
  55. background: url(images/454545_7x7_arrow_left.gif) 50% 50% no-repeat;
  56. }
  57. .ui-datepicker-next a:hover {
  58. background: url(images/454545_7x7_arrow_right.gif) 50% 50% no-repeat;
  59. }
  60. .ui-datepicker-prev a:active {
  61. background: url(images/222222_7x7_arrow_left.gif) 50% 50% no-repeat;
  62. }
  63. .ui-datepicker-next a:active {
  64. background: url(images/222222_7x7_arrow_right.gif) 50% 50% no-repeat;
  65. }
  66. .ui-datepicker-header select {
  67. border: 1px solid #d3d3d3;
  68. color: #555555;
  69. background: #e6e6e6;
  70. font-size: 1em;
  71. line-height: 1.4em;
  72. position: absolute;
  73. top: .5em;
  74. margin: 0 !important;
  75. }
  76. .ui-datepicker-header option:focus, .ui-datepicker-header option:hover {
  77. background: #dadada;
  78. }
  79. .ui-datepicker-header select.ui-datepicker-new-month {
  80. width: 7em;
  81. left: 2.2em;
  82. }
  83. .ui-datepicker-header select.ui-datepicker-new-year {
  84. width: 5em;
  85. left: 9.4em;
  86. }
  87. table.ui-datepicker {
  88. width: 15.5em;
  89. text-align: right;
  90. }
  91. table.ui-datepicker td a {
  92. padding: .1em .3em .1em 0;
  93. display: block;
  94. color: #555555;
  95. background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
  96. cursor: pointer;
  97. border: 1px solid #ffffff;
  98. }
  99. table.ui-datepicker td a:hover {
  100. border: 1px solid #999999;
  101. color: #212121;
  102. background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
  103. }
  104. table.ui-datepicker td a:active {
  105. border: 1px solid #dddddd;
  106. color: #222222;
  107. background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
  108. }
  109. table.ui-datepicker .ui-datepicker-title-row td {
  110. padding: .3em 0;
  111. text-align: center;
  112. font-size: .9em;
  113. color: #222222;
  114. text-transform: uppercase;
  115. }
  116. table.ui-datepicker .ui-datepicker-title-row td a {
  117. color: #222222;
  118. }
  119. .ui-datepicker-cover {
  120. display: none;
  121. display/**/: block;
  122. position: absolute;
  123. z-index: -1;
  124. filter: mask();
  125. top: -4px;
  126. left: -4px;
  127. width: 193px;
  128. height: 200px;
  129. }
  130.  
  131. /* current input value background color */
  132. .ui-datepicker-current-day
  133. {
  134. background: #83C948
  135. }
  136. /* today's background color */
  137. .ui-datepicker-today
  138. {
  139. background: #83C948
  140. }
  141.  
  142. this._currentClass = 'ui-datepicker-current-day';
  143. // The name of the current day marker class
  144.  
  145.  
  146. (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + ...
  147. // highlight today (if different)
  148.  
  149. .ui-state-highlight, .ui-widget-content .ui-state-highlight
  150. {
  151. background:#FFE45C url(../images/?new=ffe45c&w=1&h=100&f=png&q=100&fltr[]=over|textures/03_highlight_soft.png|0|0|75) repeat-x scroll 50% top;
  152. border:1px solid #FED22F;
  153. color:#363636;
  154. }
  155.  
  156. .ui-state-active, .ui-widget-content .ui-state-active
  157. {
  158. background:#FFFFFF url(../images/?new=ffffff&w=1&h=400&f=png&q=100&fltr[]=over|textures/02_glass.png|0|0|65) repeat-x scroll 50% 50%;
  159. border:1px solid #FBD850;
  160. color:#EB8F00;
  161. font-weight:bold;
  162. outline-color:-moz-use-text-color;
  163. outline-style:none;
  164. outline-width:medium;
  165. }
Add Comment
Please, Sign In to add comment