EN
このコンテンツは設定された言語で表示できません。英語版のページが表示されます。

dateTimeFormat

Specifies how IPropertyDescription::FormatForDisplay should format the property's value as a string. This is applicable only if <displayInfo displayType="DateTime">. 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 ElementChild Elements
displayInfo None

 

Attributes

AttributeDescription
formatAsPublic. Optional. Default is "General". The following are valid values.
ValueMeaning
GeneralDefault. 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.
MonthFormats 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.
YearMonthFormats 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.
YearFormats the value as a simple string.

 

formatTimeAsPublic. Optional. Default is "ShortTime". Specifies the format in which to display time. Applies when formatAs="General". The following are valid values.
ValueMeaning
ShortTimeDefault. Show the time like "7:48 PM".
LongTimeShow the time like "7:48:33 PM".
HideTimeDo not display the time portion of the date.

 

formatDateAsPublic. Optional. Default is "ShortDate". Specifies the format in which to display the date. Applies when formatAs="General". The following are valid values.
ValueExample
ShortDateDefault. Show the date like "5/13/59".
LongDateShow the date like "Wednesday, May 13, 1959".
HideDateDo not display the date portion.
RelativeShortDateShow the date like "ShortDate", but use relative descriptions, such as "yesterday", whenever possible.
RelativeLongDateShow the date like "LongDate", but use relative descriptions, such as "yesterday", whenever possible.

 

 

 

 

コミュニティの追加

追加
表示:
© 2014 Microsoft