function formatDuration(inStart, inEnd, inFallback) {
        let start = Date.parse(inStart),
            end,
            ret = [ ];

        if (!inEnd) {
            if (inFallback) {
                end = Date.parse(inFallback);
            } else {
                end = Date.now();
            }
        } else {
            end = Date.parse(inEnd);
        }

        let dur = (end - start) / 1000;
        let weeks = Math.floor(dur / 604800);
        let days = Math.floor((dur %= 604800) / 86400);
        let hours = Math.floor((dur %= 86400) / 3600);
        let minutes = Math.floor((dur %= 3600) / 60);
        let seconds = Math.floor(dur % 60);

        if (weeks) { ret.push(weeks + ' weeks'); }
        if (days) { ret.push(days + ' days'); }

        ret.push(hours + ' hours, ' + minutes + ' minutes and ' + seconds + ' seconds');
        return ret.join(', ');
    }
/**
     * Takes a start and end date and returns a human-readable duration
     * @param {string} inStart Start date
     * @param {string} inEnd End date
     * @param {string} inFallback Fallback date to use as the end, if inEnd is undefined. Defaults to current time
     * if not set
     * @returns {string} Human-readable formatted duration
     */
Takes a start and end date and returns a human-readable duration
@param {string} inStart Start date
@param {string} inEnd End date
@param {string} inFallback Fallback date to use as the end, if inEnd is undefined. Defaults to current time
if not set
@returns {string} Human-readable formatted duration
Takes a start and end date and returns a human - readable duration @param { string } inStart Start date @param { string } inEnd End date @param { string } inFallback Fallback date to use as the end if inEnd is undefined . Defaults to current time if not set @returns { string } Human - readable formatted duration
function formatDuration(inStart, inEnd, inFallback) {
        let start = Date.parse(inStart),
            end,
            ret = [ ];
        if (!inEnd) {
            if (inFallback) {
                end = Date.parse(inFallback);
            } else {
                end = Date.now();
            }
        } else {
            end = Date.parse(inEnd);
        }
        let dur = (end - start) / 1000;
        let weeks = Math.floor(dur / 604800);
        let days = Math.floor((dur %= 604800) / 86400);
        let hours = Math.floor((dur %= 86400) / 3600);
        let minutes = Math.floor((dur %= 3600) / 60);
        let seconds = Math.floor(dur % 60);
        if (weeks) { ret.push(weeks + ' weeks'); }
        if (days) { ret.push(days + ' days'); }
        ret.push(hours + ' hours, ' + minutes + ' minutes and ' + seconds + ' seconds');
        return ret.join(', ');
    }
function formatDuration ( inStart , inEnd , inFallback ) { let start = Date . parse ( inStart ) , end , ret = [ ] ; if ( ! inEnd ) { if ( inFallback ) { end = Date . parse ( inFallback ) ; } else { end = Date . now ( ) ; } } else { end = Date . parse ( inEnd ) ; } let dur = ( end - start ) / 1000 ; let weeks = Math . floor ( dur / 604800 ) ; let days = Math . floor ( ( dur %= 604800 ) / 86400 ) ; let hours = Math . floor ( ( dur %= 86400 ) / 3600 ) ; let minutes = Math . floor ( ( dur %= 3600 ) / 60 ) ; let seconds = Math . floor ( dur % 60 ) ; if ( weeks ) { ret . push ( weeks + ' weeks' ) ; } if ( days ) { ret . push ( days + ' days' ) ; } ret . push ( hours + ' hours, ' + minutes + ' minutes and ' + seconds + ' seconds' ) ; return ret . join ( ', ' ) ; }
Takes a start and end date and returns a human-readable duration
 @param {string} inStart Start date
 @param {string} inEnd End date
 @param {string} inFallback Fallback date to use as the end, if inEnd is undefined.
Takes a start and end date and returns a human - readable duration @param { string } inStart Start date @param { string } inEnd End date @param { string } inFallback Fallback date to use as the end if inEnd is undefined .