从 WebDataRocks“时间”JSON 类型中删除 :ss 部分

问题描述

enter image description here

我只需要使用小时和分钟部分。如何在没有 as :ss 的情况下使用“时间”JSON 类型?

Web Data Rocks JSON types

"time" data type usage example which is referred from above document page.

解决方法

我们使用customizeCell方法解决了这个问题,

function customizeCellFunction(cellBuilder,cellData){
  if(cellData && 
     cellData.hierarchy && 
     cellData.hierarchy.uniqueName==="Duration"     
  ){    
    cellBuilder.text = cellBuilder.text.slice(0,-3)  // HH:MM:ss => HH:MM 
  }
}

代码笔链接:https://codepen.io/AKCAK/pen/KKgXVwp?editors=0010