let date = new Date;
let currenciesArr = [
    "Ethereum(ETH)",
    "Ripple(XRP)",
    "Litecoin(LTC)",
    "Tether(USDT)",
    "Bitcoin Cash(BCH)",
    "Libra(LIBRA)",
    "Monero(XMR)",
    "EOS(EOS)"
]

getRandomInt = (min, max) => {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min)) + min;
}

getRandomArbitrary = (min, max) => {
    return Math.random() * (max - min) + min;
}

getDate = () => {
    return date.getFullYear() +
        "-" + (date.getMonth() + 1) +
        "-" + date.getDate() +
        " " + (date.getHours() - 1) +
        ":" + getRandomInt(10, 59) +
        ":" + getRandomInt(10, 59)
}

$(".table-date").each(function() {
    $(this).text(getDate());
})

$(".table-value").each(function() {
    $(this).text("$" + getRandomArbitrary(10, 250).toFixed(2));
})

$(".table-badge").each(function() {
    let num = getRandomInt(0, 2);

    num ? $(this).text("sell") && $(this).addClass("btn-danger") : $(this).text("buy") && $(this).addClass("btn-success")
})

$(".table-coin").each(function() {
    let num = getRandomInt(0, 8);

    $(this).text(currenciesArr[num])
})
