
function isLogoValid(logo) {
    var currentDate = new Date(Date.now());
    if(logo.startMonth == 0 && logo.startDay == 0 && logo.endMonth == 0 && logo.endDay == 0)
        return true;
    if(logo.startMonth == 0)
        logo.startMonth = currentDate.getMonth()+1;
    if(logo.startDay == 0)
        logo.startDay = currentDate.getDate();
    if(logo.endMonth == 0)
        logo.endMonth = currentDate.getMonth()+1;
    if(logo.endDay == 0)
        logo.endDay = currentDate.getDate();
        
    var startDate;
    var endDate;
    do{
        startDate = new Date(currentDate.getFullYear(), logo.startMonth-1, logo.startDay, 0, 0, 0);
        logo.startDay -= 1;
    }while(startDate == null && logo.startDay >= 0);
    do{
        endDate = new Date(currentDate.getFullYear(), logo.endMonth-1,logo.endDay,0,0,0);
        logo.endDay -= 1;
    }while(endDate == null && logo.endDay >= 0);

    if(startDate > endDate){
        if(endDate<currentDate){
            endDate.setFullYear(currentDate.getFullYear() + 1);
        }
        else{
            startDate.setFullYear(currentDate.getFullYear() - 1);
        }
    }
    return startDate<=currentDate && endDate>=currentDate;
};
module.exports = isLogoValid;