dateTimeFormat

Specifies how IPropertyDescription::FormatForDisplay should format the property's value as a string. This is applicable only if . There should be only one dateTimeFormat element for each displayInfo element.

If there are multiple elements, the last one is used. If no dateTimeFormat element is provided, then the default attribute settings are applied to the property description.

Syntax

      <!-- dateTimeFormat -->
      <xs:element name="dateTimeFormat"  minOccurs="0" maxOccurs="1">
        <xs:complexType>
          <xs:attribute name="formatAs">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="General"/>
                <xs:enumeration value="Month"/>
                <xs:enumeration value="YearMonth"/>
                <xs:enumeration value="Year"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="formatTimeAs">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="ShortTime"/>
                <xs:enumeration value="LongTime"/>
                <xs:enumeration value="HideTime"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="formatDateAs">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:enumeration value="ShortDate"/>
                <xs:enumeration value="LongDate"/>
                <xs:enumeration value="HideDate"/>
                <xs:enumeration value="RelativeShortDate"/>
                <xs:enumeration value="RelativeLongDate"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
        </xs:complexType>
      </xs:element>

Element Information

Parent Element Child Elements
displayInfo None

 

Attributes

Attribute Description
formatAs Public. Optional. Default is "General". The following are valid values.
Value Meaning
General Default. Formats the date-time value using SHFormatDateTime. Use the formatTimeAs and formatDateAs attributes to specify how the time and date are formatted. Requires the property type to be DateTime.
Month Formats the value as one of the months of the year. Requires the property type to be Int32. The value must be stored as a numeric value with 1 representing the first month of the year.
YearMonth Formats the value as "Year - Month". Requires the property type to be Int32. The value must be stored such that the two highest bytes specify the year and the lower two bytes specify the month.
Year Formats the value as a simple string.

 

formatTimeAs Public. Optional. Default is "ShortTime". Specifies the format in which to display time. Applies when formatAs="General". The following are valid values.
Value Meaning
ShortTime Default. Show the time like "7:48 PM".
LongTime Show the time like "7:48:33 PM".
HideTime Do not display the time portion of the date.

 

formatDateAs Public. Optional. Default is "ShortDate". Specifies the format in which to display the date. Applies when formatAs="General". The following are valid values.
Value Example
ShortDate Default. Show the date like "5/13/59".
LongDate Show the date like "Wednesday, May 13, 1959".
HideDate Do not display the date portion.
RelativeShortDate Show the date like "ShortDate", but use relative descriptions, such as "yesterday", whenever possible.
RelativeLongDate Show the date like "LongDate", but use relative descriptions, such as "yesterday", whenever possible.