@@ -213,7 +213,7 @@ test('Today Button: "linked" selects today\'s date', function(){
213
213
datesEqual ( dp . date , today ) ;
214
214
} ) ;
215
215
216
- test ( 'Today: today\'s date is highlighted when not active ' , patch_date ( function ( Date ) {
216
+ test ( 'Today Highlight : today\'s date is not highlighted by default ' , patch_date ( function ( Date ) {
217
217
Date . now = UTCDate ( 2012 , 2 , 15 ) ;
218
218
var input = $ ( '<input />' )
219
219
. appendTo ( '#qunit-fixture' )
@@ -229,6 +229,31 @@ test('Today: today\'s date is highlighted when not active', patch_date(function(
229
229
ok ( picker . find ( '.datepicker-days' ) . is ( ':visible' ) , 'Days view visible' ) ;
230
230
equal ( picker . find ( '.datepicker-days thead .switch' ) . text ( ) , 'March 2012' , 'Title is "March 2012"' ) ;
231
231
232
+ target = picker . find ( '.datepicker-days tbody td:contains(15)' ) ;
233
+ ok ( ! target . hasClass ( 'today' ) , 'Today is not marked with "today" class' ) ;
234
+ target = picker . find ( '.datepicker-days tbody td:contains(14)' ) ;
235
+ ok ( ! target . hasClass ( 'today' ) , 'Yesterday is not marked with "today" class' ) ;
236
+ target = picker . find ( '.datepicker-days tbody td:contains(16)' ) ;
237
+ ok ( ! target . hasClass ( 'today' ) , 'Tomorrow is not marked with "today" class' ) ;
238
+ } ) ) ;
239
+
240
+ test ( 'Today Highlight: today\'s date is highlighted when not active' , patch_date ( function ( Date ) {
241
+ Date . now = UTCDate ( 2012 , 2 , 15 ) ;
242
+ var input = $ ( '<input />' )
243
+ . appendTo ( '#qunit-fixture' )
244
+ . val ( '2012-03-05' )
245
+ . datepicker ( {
246
+ format : 'yyyy-mm-dd' ,
247
+ todayHighlight : true
248
+ } ) ,
249
+ dp = input . data ( 'datepicker' ) ,
250
+ picker = dp . picker ,
251
+ target ;
252
+
253
+ input . focus ( ) ;
254
+ ok ( picker . find ( '.datepicker-days' ) . is ( ':visible' ) , 'Days view visible' ) ;
255
+ equal ( picker . find ( '.datepicker-days thead .switch' ) . text ( ) , 'March 2012' , 'Title is "March 2012"' ) ;
256
+
232
257
target = picker . find ( '.datepicker-days tbody td:contains(15)' ) ;
233
258
ok ( target . hasClass ( 'today' ) , 'Today is marked with "today" class' ) ;
234
259
target = picker . find ( '.datepicker-days tbody td:contains(14)' ) ;
0 commit comments