JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <p>Select Date:
        <input id="input_date" type="date" value="40809-02-06"></input>
    </p>
    <p>Imperial Date:
        <input id="output" disabled></input>
    </p>
</body>

JavaScript

function ImperialCalendar(aDate) {

    this.myCheckNumber = 0;

    this.myStandardDate = (typeof aDate !== 'undefined') ? aDate : new Date();

    //If we were passed a date object but that date object is invalid the following block will find out.
    if (Object.prototype.toString.call(this.myStandardDate) === "[object Date]") {
        if (isNaN(this.myStandardDate.getTime())) {
            throw new Error("Passed value is not a proper Javascript Date object: " + aDate);
        }
    } else {
        throw new Error("Passed value is not a proper Javascript Date object: " + aDate);
    }

    /*
	@return Integer The check value for the date.
	
	This method returns the current check value being used by the date.
	*/
    this.getCheckNumber = function () {
        return this.myCheckNumber;
    }

    /*
	@param aNewCheckNumber Integer The new check number should be in accordance with imperial standards
	@return Boolean Returns True if the new check value was accepted, false otherwise.
	
	This method sets the check number. The new value should be between 0 and 9 inclusive.
	The check number should probably be left at 0, unless you are calling this from the International Space Station.
	*/
    this.setCheckNumber = function (aNewCheckNumber) {
        if (aNewCheckNumber >= 0 && aNewCheckNumber <= 9) {
            this.myCheckNumber = aNewCheckNumber;
            return true;
        }

        return false;
    }

    /*
	@return Date The stored Javascript Date Object that generates the Imperial date.
	
	This method returns the stored Javascript Date Object, perhaps so that it can checked or something.
	I'm not really sure why you'd want to retrieve it but that is for you to decide.
	*/
    this.getStandardDate = function () {
        return this.myStandardDate;
    }

    /*
	@param aNewDate Date A Javascript Date object from which to derive the imperial date.
	
	This method is used to change the internally stored date. Useful for reusing the same...