script/dao_utils.js
/**
 * Converts a unix timestamp in BigNumber form to a javascript date object.
 *
 * Returns 'null' if the timestamp is 0.
 *
 * @param {Object} timestamp - A javascript date object.
 *
 * @alias module:dao_utils.bnToDate
 */
Converts a unix timestamp in BigNumber form to a javascript date object.
Returns 'null' if the timestamp is 0.

@param {Object} timestamp - A javascript date object.


Converts a unix timestamp in BigNumber form to a javascript date object . Returns ' null ' if the timestamp is 0 . @param { Object } timestamp - A javascript date object .
function bnToDate(timestamp) {
    var tsNum = timestamp.toNumber();
    if (tsNum === 0) {
        return null;
    }
    return new Date(tsNum * 1000);
}
function bnToDate ( timestamp ) { var tsNum = timestamp . toNumber ( ) ; if ( tsNum === 0 ) { return null ; } return new Date ( tsNum * 1000 ) ; }
Converts a unix timestamp in BigNumber form to a javascript date object.
Converts a unix timestamp in BigNumber form to a javascript date object .