This repository was archived by the owner on Feb 18, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 175175 $scope . day = Number ( $filter ( 'date' ) ( new Date ( $scope . dateMinLimit ) , 'dd' ) ) ;
176176 $scope . year = Number ( $filter ( 'date' ) ( new Date ( $scope . dateMinLimit ) , 'yyyy' ) ) ;
177177
178- setDaysInMonth ( $scope . monthNumber , $scope . year ) ;
178+ setDaysInMonth ( $scope . monthNumber , $scope . year ) ;
179179 }
180180 , resetToMaxDate = function resetToMaxDate ( ) {
181181
378378 setInputValue ( ) ;
379379 }
380380 }
381+ } )
382+ , unregisterDateMinLimitWatcher = $scope . $watch ( 'dateMinLimit' , function dateMinLimitWatcher ( newValue ) {
383+ if ( newValue ) {
384+ resetToMinDate ( ) ;
385+ }
381386 } ) ;
382387
383388 $scope . nextMonth = function nextMonth ( ) {
488493 $scope . monthNumber = Number ( $filter ( 'date' ) ( new Date ( selectedMonthNumber + '/01/2000' ) , 'MM' ) ) ;
489494 setDaysInMonth ( $scope . monthNumber , $scope . year ) ;
490495 setInputValue ( ) ;
491- } ;
492-
493- $scope . $watch ( 'dateMinLimit' , function ( ) {
494- if ( $scope . dateMinLimit )
495- resetToMinDate ( ) ;
496- } )
497-
496+ } ;
498497
499498 $scope . setNewYear = function setNewYear ( year ) {
500499
839838 $scope . $on ( '$destroy' , function unregisterListener ( ) {
840839
841840 unregisterDataSetWatcher ( ) ;
841+ unRegisterDateMinLimitWatcher ( ) ;
842842 thisInput . off ( 'focus click focusout blur' ) ;
843843 angular . element ( theCalendar ) . off ( 'mouseenter mouseleave focusin' ) ;
844844 angular . element ( $window ) . off ( 'click focus focusin' , onClickOnWindow ) ;
You can’t perform that action at this time.
0 commit comments