The Common-Controls Tag Library

<convert:convertDateTime>

Register a DateTimeConverter instance on the UIComponent associated with the closest parent UIComponent custom action.
must be nested within a ConversionSupportTag

Tag class: ConvertDateTimeTag
Tei class: ConverterTei
 

[ Syntax ]

Standard Syntax
<convert:convertDateTime
[ dateStyle = "{default | short | medium | long | full}" ]
[ locale = "String" ]
[ pattern = "String" ]
[ timeStyle = "String" ]
[ timeZone = "String" ]
[ type = "String" ]
/>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
dateStyleString Predefined formatting style which determines how the date component of a date string is to be formatted and parsed. Applied only if type is "date" or "both".
  • default =
  • short =
  • medium =
  • long =
  • full =
 
localeString Locale whose predefined styles for dates and times are used during formatting or parsing. If not specified, the Locale returned by RequestContext.getLocale() will be used. Value must be either an expression that evaluates to a java.util.Locale instance, or a String that is valid to pass as the first argument to the constructor java.util.Locale(String language, String country). The empty string is passed as the second argument.  
patternString Custom formatting pattern which determines how the date/time string should be formatted and parsed.  
timeStyleString Predefined formatting style which determines how the time component of a date string is to be formatted and parsed. Applied only if type is "time" or "both". Valid values are "default", "short", "medium", "long", and "full". Default value is "default".  
timeZoneString Time zone in which to interpret any time information in the date String. Value must be either an expression that evaluates to a java.util.Timezone instance, or a String that is a timezone ID as described in the javadocs for java.util.TimeZone.getTimeZone().  
typeString Specifies what contents the string value will be formatted to include, or parsed expecting. Valid values are "date", "time", and "both". Default value is "date".  

[ Example ]

Usage of the DateTimeConverter


<%@ taglib uri="http://struts.apache.org/tags-html"               prefix="html" %>
<%@ taglib uri="http://www.common-controls.com/cc/tags-forms"      prefix="forms" %>
<%@ taglib uri="http://www.common-controls.com/cc/tags-converter"   prefix="convert" %>

<html:form action="/sample809/converterdemo">

   <forms:form 
      type="edit"
      caption="converter.examples.caption" 
      formid="frmEdit" 
      width="550"  
      help="HID-100">


      <forms:text  
         label="form.convert.convertDateTime"
         property="datetime" 
         size="20" 
         maxlength="20" 
         required="true"  
         help="HID-101">


         <convert:convertDateTime dateStyle="short"/>
      </forms:text>

      <forms:buttonsection default="btnSave">
         <forms:button  name="btnSave"    text="button.title.save"    title="button.title.save"/>
      </forms:buttonsection>
   </forms:form>

</html:form>