Forum Discussion

shanebekker's avatar
shanebekker
Copper Contributor
May 01, 2019

Format view json not getting date format correct

 

The following Json formatting code gives me the incorrect row highlighting as seen below. Why and how to fix it please.
{
  "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
  "additionalRowClass": "=if([$Order_x0020_Date]< [$Arrival_x0020_Date],'ms-fontColor-neutralSecondary ms-fontColor-redDark ms-fontSize-mPlus ms-fontWeight-bold sp-field-severity--blocked','')"
}

 

4 Replies

  • shanebekker 

     

    Can you try the below?

     

    {
        "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
        "additionalRowClass": "=if( Date(toDateString([$Order_x0020_Date])) < Date(toDateString([$Arrival_x0020_Date])),'ms-fontColor-neutralSecondary ms-fontColor-redDark ms-fontSize-mPlus ms-fontWeight-bold sp-field-severity--blocked','')"
    }

     

      • Shreyansh Agrawal's avatar
        Shreyansh Agrawal
        Icon for Microsoft rankMicrosoft

        shanebekker 

         

        Can you share the following details -

        1. Field type for Order Date & Arrival Date [Date or Calculated Date]
        2. Are you using SharePoint OnPrem or SharePoint Online

Resources