1

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 1

2

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>
3
  • Where should I put that <property>?
    – Jussi Palo
    Commented Aug 20, 2013 at 13:16
  • 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" ... >
    – Jussi Palo
    Commented Aug 20, 2013 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.