private void userSelectedADate ( LocalDate selectedDate ) { // Skip this function if the settings have not been applied. if ( settings == null ) { return ; } // If a date was selected and the date is vetoed, do nothing. if ( selectedDate != null ) { DateVetoPolicy vetoPolicy = settings . getVetoPolicy ( ) ; if ( InternalUtilities . isDateVetoed ( vetoPolicy , selectedDate ) ) { return ; } } // Save the selected year and month, in case it is needed later. YearMonth oldYearMonth = displayedYearMonth ; if ( selectedDate != null ) { YearMonth selectedDateYearMonth = YearMonth . from ( selectedDate ) ; displayedYearMonth = selectedDateYearMonth ; } else { // The selected date was cleared, so set the displayed YearMonth to the default value. displayedYearMonth = settings . zGetDefaultYearMonthAsUsed ( ) ; } // Save the selected date, redraw the calendar, and notify any listeners. zInternalChangeSelectedDateProcedure ( selectedDate , oldYearMonth ) ; // If this calendar panel is associated with a date picker, then set the DatePicker date // and close the popup. if ( settings . getParentDatePicker ( ) != null ) { DatePicker parent = settings . getParentDatePicker ( ) ; parent . setDate ( selectedDate ) ; parent . closePopup ( ) ; } }
userSelectedADate This is called any time that the user makes a date selection on the calendar panel including choosing to clear the date . If this calendar panel is being used inside of a DatePicker then this will save the selected date and close the calendar . The only time this function will not be called during an exit event is if the user left focus of the component or pressed escape to cancel choosing a new date .