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

matt howell 331 Reputation points

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?

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

2 answers

Sort by: Most helpful
  1. matt howell 331 Reputation points

    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,056 Reputation points

    @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:


    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