Skip to main content

Posts

Showing posts with the label ADF date converter multiple patterns

ADF Date convert secondary pattern

This will try the second pattern if there is an error with the first. This should sort out most situations you need else you will need to write a custom tag. <af:convertDateTime pattern="yyyyMMdd" secondaryPattern="yyyy-MM-dd" /> NOTE: interesting javascript override Java [custom converter] public class YourDateConverter extends DateTimeConverter implements ClientConverter { public Object getAsObject( FacesContext facesContext, UIComponent uiComponent, String string){//do convert here} public String getAsString( FacesContext facesContext, UIComponent uiComponent, Object object) {//do convert here} public java.lang.String getClientConversion( javax.faces.context.FacesContext fc, javax.faces.component.UIComponent c){ String conv = super.getClientConversion(fc, c); return "new YourDateTimeConverter('dd/MM/yyyy',null,'01/11/2010','DATE')"; } Javascript: function YourDateTimeConverter( pattern, locale...