Portlet Factory, Version 6.1.2


 

Validating date and time with the Date/Time Formatter builder

The Date/Time Formatter builder can be used to validate dates and times.

  1. Open the Date/Time Formatter builder, and follow these steps:

    1. If the variable to validate is a DateTime or dateTime data type, do nothing. The Date/Time Formatter will try to validate the date according to several formats already included in the builder.

      If you scroll down the Date, Time, and DateTime fields and do not see the format you wish to use, then you can enter this format in the Requested Parsers fields. The builder will attempt all formats in these fields from top to bottom first, before it attempts to parse the formats that are built into IBM® WebSphere Portlet Factory Designer.

      Requested Parsers: Format: dd MM yyyy hh:mm
    2. If the variable you wish to validate is not a DateTime or dateTime data type, but should be treated like one of these data types, such as a Sstring, then enter this variable in the Fields: field. This will tell the builder to attempt to convert/cast the data type that the variable is declared to be into a valid dateTime or DateTime data type. Then the builder will attempt to parse the variable to see if it matches a format in the builder or one in the Requested Parsers field.

  2. For each variable you can also decide how you would like the builder to convert this variable. In the "Fields" Table, enter DateTime, Date, or Time
    Fields: Fields: Type
    [page2]dateTimeVarDisplay/dateTimeVar DateTime

  3. Place a Data Page Formatter builder at the bottom of the builder call list.

Parent topic: Formatting Date and Time values


Library | Support |