通过ajax发布将日期设置为空

如果选择输入的值不是“已完成”,我试图将MySQL中的日期值设置为null。我正在使用以下代码:

$(document).ready(function(){

    var foundTaskID = 0;
    var currStatus = '';

    var today = new Date();
    var currDate = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();


    $(".selTaskStatus").on("change",function(){
        var currentRow=$(this).closest("tr");
        foundTaskID=currentRow.find("td:eq(0)").html();
        currStatus = this.value;

        if (currStatus == 'Completed'){
        $.ajax({
            method: "POST",
            url: "../tasks/updateTaskOwner.php",
            data: { TaskStatus: currStatus, TaskID: foundTaskID, TaskEndDate: currDate }
            }); 
        } else {

        var TED = null;

        $.ajax({
            method: "POST",
            url: "../tasks/updateTaskOwner.php",
            data: { TaskStatus: currStatus, TaskID: foundTaskID, TaskEndDate: TED }
            });   
        }  
    });
  });

如果currStatus的值是“ Completed”,则一切正常,但如果不是,则失效。

任何帮助,不胜感激