我的应用程序中有一个网格,它在字段中显示日期。现在,如果这一天在上周,我想以粗体格式显示该字段。但在两行显示我想要的输出。我不明白我的病情出在哪里。有人可以帮我吗?这是我的代码如下:
{
text: 'Start',
dataIndex: 'weekstart',
flex: 1,
renderer: function(value, metaData){
var day = new Date(value) - 0,
lastDay = Ext.Date.getLastDateOfMonth(value)-0,
lastWeek = lastDay - 7;
console.log('day >>> '+day,'lastDay >>> '+ lastDay, 'lastWeek >>> '+lastWeek);
return day >= lastWeek ? '<b>' + Ext.Date.format(value, 'M d, Y') + '</b>' : Ext.Date.format(value, 'M d, Y') ;
}
}