如果网格上的日期即将到期,即“调查到期 - 2020 年 1 月 1 日”,则尝试为单元格着色,并且我希望当今天的日期在供应商到期 5 个月内时单元格变为红色。请帮忙
var today = new Date();
var curr_date = today.getDate();
var curr_month = today.getMonth() + 1;
var curr_year = today.getFullYear();
var todayMan = curr_month + '/' + curr_date + '/' curr_year
class Bsall extends React.Component {
constructor(props) {
super(props)
this.state = {
items: [],
columnDefs: [
{headerName: "Supplier Status", field: "supplier_status", sortable: true, filter: true},
{headerName: "Survey Exp", field: "survey_exp", sortable: true, filter: true, cellStyle:
params => {
if (params.value < todayMan + 5) {
return {'background-color': 'red'}}
}},