src/util.js
function coerceDate(value) {
    if (value instanceof Date) {
        return value;
    }

    let timestamp = Date.parse(value);

    if (!isNaN(timestamp)) {
        return new Date(timestamp);
    }

    return value;
}
function coerceDate(value) {
    if (value instanceof Date) {
        return value;
    }

    let timestamp = Date.parse(value);

    if (!isNaN(timestamp)) {
        return new Date(timestamp);
    }

    return value;
}
function coerceDate ( value ) { if ( value instanceof Date ) { return value ; } let timestamp = Date . parse ( value ) ; if ( ! isNaN ( timestamp ) ) { return new Date ( timestamp ) ; } return value ; }
Tries to convert the value to Date. First it try to parse it and if it gets a number,
the Date constructor will be fed with that.

@param {*} value
@returns {*}
Tries to convert the value to Date . First it try to parse it and if it gets a number the Date constructor will be fed with that .