Need Column format for formatting date sharepoint online sharepoint default format is 10/30/2020 I need it as Oct 30, 2020

568 Views Asked by At

I am trying to format the date from 10/30/2020 to Oct 30, 2020 using the SharePoint online column formatting. Can someone please help me out with JSON format which convert my date to any specific format which was passed as a parameter.

Thanks in Advance.

1

There are 1 best solutions below

1
Baker_Kong On

@Dinesh Talekar,

Please take a reference of below JSON code:

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "=if(getMonth(@currentField)==0, 'Jan', if(getMonth(@currentField)==1, 'Feb', if(getMonth(@currentField)==2, 'Mar', if(getMonth(@currentField)==3, 'Apr', if(getMonth(@currentField)==4, 'May', if(getMonth(@currentField)==5, 'Jun', if(getMonth(@currentField)==6, 'Jul', if(getMonth(@currentField)==7, 'Aug', if(getMonth(@currentField)==8, 'Sep', if(getMonth(@currentField)==9, 'Oct', if(getMonth(@currentField)==10, 'Nov', 'Dec')))))))))))+ ' '+getDate(@currentField)+','+ getYear(@currentField)",
    "style": {
        "color": "#ff0000"
    }
}

Test Result:

enter image description here

BR