0

I'm new to JSON Formatter and I need to format a list in gallery view. I have a date and time field, and I am using the expression "=toLocaleTimeString([$Date])", but the time is being displayed like this 15:05:00 PM, I would like it to display only 15:05 PM without the seconds

2 Answers 2

0

I am not sure if there is such an option in JSON Formatter. Alternatively, you can create a Calculated Column for such a purpose instead. In your gallery view, display this Calculated Column instead of the original Date/Time column.

Formula to use: =TEXT(Date,"h:mm am/pm")

This is the 'Calculated Column' details: enter image description here

How the gallery view will look like: enter image description here

0

Try to use the following code:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "inlineEditField": "@currentField",
  "txtContent": "@currentField"
}

Reference:https://techcommunity.microsoft.com/t5/sharepoint/date-time-column-displays-seconds-if-i-apply-json/m-p/3726339

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.