SOURCE

function main(_row){

    function getNowFormatDay(nowDate){
        var char='-';
        if(nowDate==null){
            nowDate=new Date();
            }
            var day=nowDate.getDate();
            var month=nowDate.getMonth()+1;
            var year=nowDate.getFullYear();
            return year+char+completeDate(month)+char+completeDate(day);
            }
    function completeDate(value){
        return value<10?'0'+value:value;
        }
    if(_row.begin_date<= '2022-03-13' &&_row.end_date>='2022-03-13')
    {
        var newdate_str=getNowFormatDay()
        return newdate_str;
    }
    else{
        return '无效'
        }
}

var _row={"begin_date":'2022-03-12',"end_date":'2022-03-16'}

var result=main(_row)

var new_date=new Date().toLocaleDateString()

// print(new_date)
console.log(new_date)
console.log(result)
console 命令行工具 X clear

                    
>
console