3

On a standard Date field that is inputted, can I display a full data format (example Friday, 23 March 2018 instead of 23/03/18) with Json to place in the column settings? Please advise

1

Currently this doesn't seem to be possible. The official documentation for Column formatting says that there are three options that we can use for formatting date objects:

toLocaleString() - Displays a date type fully expanded with date and time.
toLocaleDateString() - Displays a date type with just the date.
toLocaleTimeString() - Displays a date type with just the time.

EDIT: In order to use this format, you would just need to paste the following code into the column Formatting box (you would just need to change the "operator" if you want other format):

{
   "elmType": "div",
   "txtContent": {
        "operator": "toLocaleString()",
        "operands" : ["@currentField"]
    }
}

What you could do instead, is create additional calculated column with the following formula, and show that column instead of your date column:

=CONCATENATE(TEXT([Datum],"DDDD"),", ",TEXT([Datum],"DD")," ",TEXT([Datum],"MMMM")," ",TEXT([Date],"YY"))
  • in case i were ok with one of the 3 above it would just be enough for me to type in the box 'toLocaleString()' ? – susan Mar 26 '18 at 8:13
  • Please see my edits for the json code. – Damjan Tomic Mar 26 '18 at 8:31
  • I have just tried your code and the date remains exactly the same. It was 23/03/2018 and after the code it is still 23/03/2018. I have tried the first operator and the second. The date column is set to display standard (and not friendly) dates. what am i doing wrong? – susan Mar 26 '18 at 12:15
0

The code in the replies above is correct however the json formatting works only in the new experience view of the list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.