After few hours I still dont know how to do the following: Customer wants to display last 5 documents with search engine. I am able to write the query and also order the documents by modified date. However I am not able to fetch the modified date to search results. I can take the write element property however client wants also the time.
1 Answer
DateFormat property is used for specifying the date and time formatting for the CoreResultsWebPart web part.
By default search results in the web part are displayed in DateOnly format.
Usage
This property could not be specified using web part editor, so please consider another options for specifying it value, for example SharePoint Designer.
For example, after specifying this property value to DateTime
:
<property name="DateFormat" type="Microsoft.SharePoint.Utilities.SPDateFormat, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">DateTime</property>
write
property would be displayed like this:
<write>2/12/2013 12:58 PM</write>
-
-
It could not be specified via Web Part Tool,but there are another options that allows to provide this property: 1)via SPD 2)Export web part, specify this property and add it on page again 3)during web part provisioning Commented Aug 20, 2013 at 13:27
-
To anyone else wondering, with SPD, you should have it as a attribute of the WebControls:CoreResultsWebPart, like this: <WebControls:CoreResultsWebPart DateFormat="DateTime" ... > Commented Aug 20, 2013 at 13:32