@@ -54,6 +54,10 @@ return $.widget( "ui.calendar", {
54
54
} ,
55
55
dateFormat : { date : "short" } ,
56
56
eachDay : $ . noop ,
57
+ icons : {
58
+ prevButton : "ui-icon-circle-triangle-w" ,
59
+ nextButton : "ui-icon-circle-triangle-e"
60
+ } ,
57
61
labels : {
58
62
"datePickerRole" : "date picker" ,
59
63
"nextText" : "Next" ,
@@ -309,20 +313,21 @@ return $.widget( "ui.calendar", {
309
313
_buildHeaderButtons : function ( ) {
310
314
var buttons = $ ( "<div>" ) ;
311
315
312
- this . prevButton = $ ( "<button>" , {
313
- html : "<span class='ui-icon ui-icon-circle-triangle-w'></span>"
314
- } ) ;
315
- this . nextButton = $ ( "<button>" , {
316
- html : "<span class='ui-icon ui-icon-circle-triangle-e'></span>"
317
- } ) ;
318
-
319
- this . _addClass ( buttons , "ui-calendar-header-buttons" )
320
- . _addClass ( this . prevButton , "ui-calendar-prev" )
321
- . _addClass ( this . nextButton , "ui-calendar-next" ) ;
316
+ this . _addClass ( buttons , "ui-calendar-header-buttons" ) ;
322
317
323
318
return buttons
324
- . append ( this . prevButton )
325
- . append ( this . nextButton ) ;
319
+ . append ( this . prevButton = this . _buildIconButton ( "prev" ) )
320
+ . append ( this . nextButton = this . _buildIconButton ( "next" ) ) ;
321
+ } ,
322
+
323
+ _buildIconButton : function ( key ) {
324
+ var button = $ ( "<button>" ) ,
325
+ icon = $ ( "<span>" ) ;
326
+
327
+ this . _addClass ( button , "ui-calendar-" + key )
328
+ . _addClass ( icon , null , "ui-icon " + this . options . icons [ key + "Button" ] ) ;
329
+
330
+ return button . append ( icon ) ;
326
331
} ,
327
332
328
333
_buildHeader : function ( ) {
0 commit comments