@@ -253,6 +253,10 @@ angular.module('ui.bootstrap.datepicker', ['ui.bootstrap.position'])
253253
254254. constant ( 'datepickerPopupConfig' , {
255255 dateFormat : 'yyyy-MM-dd' ,
256+ currentText : 'Today' ,
257+ toggleWeeksText : 'Weeks' ,
258+ clearText : 'Clear' ,
259+ closeText : 'Done' ,
256260 closeOnDateSelection : true
257261} )
258262
@@ -266,12 +270,25 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
266270 var closeOnDateSelection = angular . isDefined ( attrs . closeOnDateSelection ) ? scope . $eval ( attrs . closeOnDateSelection ) : datepickerPopupConfig . closeOnDateSelection ;
267271 var dateFormat = attrs . datepickerPopup || datepickerPopupConfig . dateFormat ;
268272
269- // create a child scope for the datepicker directive so we are not polluting original scope
273+ // create a child scope for the datepicker directive so we are not polluting original scope
270274 var scope = originalScope . $new ( ) ;
271275 originalScope . $on ( '$destroy' , function ( ) {
272276 scope . $destroy ( ) ;
273277 } ) ;
274278
279+ attrs . $observe ( 'currentText' , function ( text ) {
280+ scope . currentText = angular . isDefined ( text ) ? text : datepickerPopupConfig . currentText ;
281+ } ) ;
282+ attrs . $observe ( 'toggleWeeksText' , function ( text ) {
283+ scope . toggleWeeksText = angular . isDefined ( text ) ? text : datepickerPopupConfig . toggleWeeksText ;
284+ } ) ;
285+ attrs . $observe ( 'clearText' , function ( text ) {
286+ scope . clearText = angular . isDefined ( text ) ? text : datepickerPopupConfig . clearText ;
287+ } ) ;
288+ attrs . $observe ( 'closeText' , function ( text ) {
289+ scope . closeText = angular . isDefined ( text ) ? text : datepickerPopupConfig . closeText ;
290+ } ) ;
291+
275292 var getIsOpen , setIsOpen ;
276293 if ( attrs . isOpen ) {
277294 getIsOpen = $parse ( attrs . isOpen ) ;
@@ -431,7 +448,7 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
431448 } ;
432449} ] )
433450
434- . directive ( 'datepickerPopupWrap' , [ function ( ) {
451+ . directive ( 'datepickerPopupWrap' , function ( ) {
435452 return {
436453 restrict :'E' ,
437454 replace : true ,
@@ -444,4 +461,4 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
444461 } ) ;
445462 }
446463 } ;
447- } ] ) ;
464+ } ) ;
0 commit comments