您好,我想对单元格添加红绿灯,如下代码,请问可以判断日期吗?需要怎么写呢?我看 GC.Spread.Sheets.ConditionalFormatting.IconValueType 里没有日期类型,所以比较困惑。感谢!
- //红绿灯
- let range; // Type: Range
- let rangeArr = [];
- for(let i = 0; i < 13; i++){
- range = new GC.Spread.Sheets.Range(2, 3+3*i, 21, 1);
- rangeArr.push(range);
- }
- var iconSetRule = new GC.Spread.Sheets.ConditionalFormatting.IconSetRule();
- iconSetRule.ranges( rangeArr );
- iconSetRule.iconSetType(GC.Spread.Sheets.ConditionalFormatting.IconSetType.threeTrafficLightsUnrimmed);
- var iconCriteria = iconSetRule.iconCriteria();
- iconCriteria[0] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, -0.02);
- iconCriteria[1] = new GC.Spread.Sheets.ConditionalFormatting.IconCriterion(true, GC.Spread.Sheets.ConditionalFormatting.IconValueType.number, 0);
- iconSetRule.reverseIconOrder(false);
- iconSetRule.showIconOnly(false);
- sheet.conditionalFormats.addRule(iconSetRule);
复制代码
|