How to use the moment.unix function in moment

To help you get started, we’ve selected a few moment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github binary-com / binary-static / src / javascript / _common / base / gtm.js View on Github external
bom_account_type  : ClientBase.getAccountType(),
            bom_currency      : ClientBase.get('currency'),
            bom_country       : get_settings.country,
            bom_country_abbrev: get_settings.country_code,
            bom_email         : get_settings.email,
            url               : window.location.href,
            bom_today         : moment_now.unix(),
        };

        if (is_new_account) {
            data.event = 'new_account';
            data.bom_date_joined = data.bom_today;
        }

        if (!ClientBase.get('is_virtual')) {
            data.bom_age       = moment_now.diff(moment.unix(get_settings.date_of_birth).utc(), 'year');
            data.bom_firstname = get_settings.first_name;
            data.bom_lastname  = get_settings.last_name;
            data.bom_phone     = get_settings.phone;
        }

        if (login_event) {
            data.event = login_event;
            BinarySocket.wait('mt5_login_list').then((response) => {
                (response.mt5_login_list || []).forEach((obj) => {
                    const acc_type = (ClientBase.getMT5AccountType(obj.group) || '')
                        .replace('real_vanuatu', 'financial')
                        .replace('real_svg', 'financial')
                        .replace('vanuatu_', '')
                        .replace('svg_', '')
                        .replace(/svg/, 'gaming'); // i.e. financial_cent, demo_cent, demo_gaming, real_gaming
                    if (acc_type) {
github PolymathNetwork / polymath-core / CLI / commands / wallet_manager.js View on Github external
row => web3.utils.isAddress(row[0]) &&
      typeof row[1] === 'string' &&
      (!isNaN(row[2])) &&
      (!isNaN(row[3] && (parseFloat(row[3]) % 1 === 0))) &&
      (!isNaN(row[4] && (parseFloat(row[3]) % 1 === 0))) &&
      moment.unix(row[5]).isValid()
  );
github sandiz / rs-manager / src / Components / songlistView.js View on Github external
export function lastPlayedFormatter(cell, row) {
  const dateLas = row.date_las;
  const dateSA = row.date_sa;
  if ((dateLas == null && dateSA == null) || (dateLas === 0 && dateSA === 0)) {
    return <span>-</span>
  }
  if (dateSA &gt; dateLas) {
    const m = moment.unix(dateSA);
    return <span>{m.fromNow()} (SA) </span>
  }
  else {
    const m = moment.unix(dateLas);
    return <span>{m.fromNow()}</span>
  }
}
export function idClass(cell, row, rowIndex, colIndex) {
github alecdibble / nama / src / services / syncHelper.js View on Github external
syncStatus: () => {
    if(shell.which('nama-sync')) {
      var syncStatus = db.getSyncStatus();
      if(syncStatus && syncStatus['synced_datetime']) {
        alert("\x1b[4mAliaSync\x1b[0m: (nama-sync) last synced:\n" + moment.unix(db.getSyncStatus()['synced_datetime']).format("dddd, MMMM Do YYYY, h:mm:ss a"))
      }
    }
  }
}
github janx / ethpanel / app / js / utils / PrettyPrintUtils.js View on Github external
time: function(timestamp) {
    return moment.unix(timestamp).format("HH:mm:ss");
  },
github OasisDEX / oasis-react / src / components / OasisChartPrice.jsx View on Github external
showTooltip(tooltip) {
    const tooltipEl = tooltipContainer(tooltip, document.getElementsByClassName("chartjs-render-monitor")[0]);
    if (tooltipEl &amp;&amp; tooltip.body) {
      const ts = this.props.priceChartLabels[tooltip.dataPoints[0].index];
      const date = moment.unix(ts).format('ll');
      const time = moment.unix(ts).format('LT');
      tooltipEl.innerHTML =
        `<div class="row-custom-tooltip">
          <span class="left">Date</span>
          <span class="right">${date}</span>
        </div>
        <div class="row-custom-tooltip middle">
          <span class="left">Time</span>
          <span class="right">${time}</span>
        </div>
        <div class="row-custom-tooltip middle">
          <span class="left">Price</span>
          <span class="right">${tooltip.dataPoints[0].yLabel}</span>
        </div>`;
      tooltipEl.style.opacity = 1;
    }
github Neufund / ESOP-ui / src / components / EmployeeList.js View on Github external
(
                
                  <a href="{ContractUtils.formatEtherscanUrl(employee.address,">
                    link
                  </a>{employee.address}
                
                
                  {moment.unix(employee.issueDate).format(Config.dateFormat)}
                
                
                  {numberFormatter.format(employee.poolOptions + employee.extraOptions)}
                
                
                  {numberFormatter.format(employee.vestedOptions)}
                
                
                  {ContractUtils.getEmployeeStateName(employee.state, employee.suspendedAt, employee.timeToSign &lt;= currentBlockTimestamp)}
                
              )
            )}
github LianjiaTech / fee / server / src / routes / api / error / viser / area / stack_area / index.js View on Github external
}
    const detailList = []
    if (detail.length > 0) {
      detailList.push(detail)
    }
    let rawRecordList = await MErrorES.asyncGetStackAreaDistribution(projectId,
      startAt, endAt, countType, errorNameList, urlList, detailList,
      errorDetailText, errorUuid, errorUcid)

    let recordList = []
    for (let rawRecord of rawRecordList) {
      let index = _.get(rawRecord, ['index'], 0)
      let errorName = _.get(rawRecord, ['error_name'], '')
      let errorCount = _.get(rawRecord, ['error_count'], 0)

      let formatedIndex = moment.unix(index).format(displayFormatTpl)
      recordList.push({
        index: index,
        name: errorName,
        value: errorCount,
        index_display: formatedIndex
      })
    }

    res.send(API_RES.showResult(recordList))
  })
github 5calls / 5calls / src / components / profile / ProfilePage.tsx View on Github external
firstCallTime(callDetails?: UserCallDetails): String {
    if (callDetails && callDetails.firstCallTime > 0) {
      const firstCall = moment.unix(callDetails.firstCallTime);
      return 'Making Calls Since ' + firstCall.format('MMMM YYYY');
    }

    return '';
  }
github Graylog2 / graylog2-server / graylog2-web-interface / src / legacy / rickshaw-helper.js View on Github external
_correctDataRightBoundary: function (data, boundary, resolution) {
        var lastDataPoint = data[data.length-1];
        if (boundary &gt; lastDataPoint.x) {
            var nextPointInTime = moment.unix(lastDataPoint.x).add(1, resolution).unix();
            if (nextPointInTime &lt; boundary) {
                data.push({"x": nextPointInTime, "y": 0});
            }
            data.push({"x": boundary, "y": 0});
        }
    }
};