PnP modern search results web part - format modified date as "friendly" in display template

matt howell 331 Reputation points
2022-02-07T22:39:25.557+00:00

I included the managed property for the modified date field in a display template, but it formats as "2022-02-02T19:13:36Z" instead of the friendly format set in the field's settings. Is there a way to ensure the date format is friendly?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,761 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. matt howell 331 Reputation points
    2022-02-11T15:40:10.927+00:00

    I'm asking for fellow user support, not necessarily Msft support - the modern search web parts are part of the Msft supported PnP development program so I'd expect a community based forum about Msft platforms to be the best place to get community help. The github site you linked to is really for issue reporting and enhancement requests, not getting development help.
    Anyway I was able to figure it out - to change the date format you can use the handlebars helper "getDate" and then the standard DD MMMM, YYYY format.

    1 person found this answer helpful.

  2. JoyZ 18,046 Reputation points
    2022-02-08T07:18:31.84+00:00

    @matt howell ,

    Since this is a custom SPFx web part beyond our support, we recommend that you open a new issue at this link as follows:

    172118-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments