Forum Discussion

Nils_Kirsch's avatar
Nils_Kirsch
Copper Contributor
Mar 10, 2023
Solved

View Formatting =toLocaleDateString is breaking for last created item

Hello,

 

I am working on a solution to display short status messages on our SPO Homesite.

I am nearly there, but there is an annoying behaviour with one date displayed on the card.

To represent the date when the status messages was created I use the following code in the txt-content property:

"txtContent": "='\n' + if([$ImgHover], '👩‍💻 ', '') +'[$Author.title]' + ' ' + '=toLocaleDateString([$Created])'",
 
this works quite well, but sometimes breaks and the last created item is represented as in the screenshot. Do you have any solution in mind to tackle that behaviour? 
 




  • Nils_Kirsch Try using this: 

     

    "txtContent": "='\n' + if([$ImgHover], ':woman_technologist: ', '') + [$Author.title] + ' ' + toLocaleDateString([$Created])",

     


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

3 Replies

  • Nils_Kirsch Try using this: 

     

    "txtContent": "='\n' + if([$ImgHover], ':woman_technologist: ', '') + [$Author.title] + ' ' + toLocaleDateString([$Created])",

     


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

    For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

    • Nils_Kirsch's avatar
      Nils_Kirsch
      Copper Contributor
      Thank you so much Ganesh. Looks like it's working. Have a wonderful day.
      • ganeshsanap's avatar
        ganeshsanap
        MVP

        Nils_Kirsch You're welcome, glad it worked for you. Have a good day ahead!


        Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

        For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

Resources