JSFiddle - React, Tailwind, and code Playground

by Mahendra Maurya

JavaScript

Standard Function to get Previous and After date::

function createDate(days, months, years) {
        var date = new Date(); 
        date.setDate(date.getDate() + days);
        date.setMonth(date.getMonth() + months);
        date.setFullYear(date.getFullYear() + years);
        return date;    
    }
    
    console.log("Output: ",createDate(0, 0, -1));