The problem is that the span tag in FolderTitle.tsx component can't render the Date object which is being passed with 'item.modified'. The FolderTile.tsx is a child component in TilesList.tsx which is why the Tiles layout closes the property pane when that layout is selected.
My error message was that React cannot render an object or something to that effect. Unfortunately, I don't have a screenshot of the error to show here.
To fix this behaviour, .toLocaleDateString() is called to display the date that was intended in the 'item.modified' Date object and get the site locale by prop-drilling to pass the SharePoint context value .currentCultureName. In case context is undefined or null, I'm setting a fallback to 'en-US'.
What the folder with a date looks like with an 'en-UK' locale set on the workbench:
What's in this Pull Request?
Fix for issue #562 PR to go with my comment for the issue here: https://github.com/pnp/sp-dev-fx-property-controls/issues/562#issuecomment-1778810710
The problem is that the span tag in FolderTitle.tsx component can't render the Date object which is being passed with 'item.modified'. The FolderTile.tsx is a child component in TilesList.tsx which is why the Tiles layout closes the property pane when that layout is selected.
My error message was that React cannot render an object or something to that effect. Unfortunately, I don't have a screenshot of the error to show here.
To fix this behaviour, .toLocaleDateString() is called to display the date that was intended in the 'item.modified' Date object and get the site locale by prop-drilling to pass the SharePoint context value .currentCultureName. In case context is undefined or null, I'm setting a fallback to 'en-US'.
What the folder with a date looks like with an 'en-UK' locale set on the workbench:![image](https://github.com/pnp/sp-dev-fx-property-controls/assets/64632596/d0d1a68a-2e21-4aa8-aa8a-cd6b0fe4f16a)