private void applyConverterPattern(FacesContext facesContext, UIPopup popup, String converterPattern) {
UIComponent box = (UIComponent) popup.getChildren().get(0);
UIComponent timePanel = box.findComponent("timePanel");
if (converterPattern != null && (converterPattern.indexOf('h') > -1 || converterPattern.indexOf('H') > -1)) {
UITime time = (UITime) timePanel.findComponent("time");
DateTimeConverter dateTimeConverter
= (DateTimeConverter) facesContext.getApplication().createConverter(DateTimeConverter.CONVERTER_ID);
if (converterPattern.indexOf('s') > -1) {
dateTimeConverter.setPattern("HH:mm:ss");
} else {
dateTimeConverter.setPattern("HH:mm");
}
dateTimeConverter.setTimeZone(TimeZone.getDefault());
time.setConverter(dateTimeConverter);
} else {
timePanel.setRendered(false);
}
}