Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) {
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()
);
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 > 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) {
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"))
}
}
}
}
time: function(timestamp) {
return moment.unix(timestamp).format("HH:mm:ss");
},
showTooltip(tooltip) {
const tooltipEl = tooltipContainer(tooltip, document.getElementsByClassName("chartjs-render-monitor")[0]);
if (tooltipEl && 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;
}
(
<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 <= currentBlockTimestamp)}
)
)}
}
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))
})
firstCallTime(callDetails?: UserCallDetails): String {
if (callDetails && callDetails.firstCallTime > 0) {
const firstCall = moment.unix(callDetails.firstCallTime);
return 'Making Calls Since ' + firstCall.format('MMMM YYYY');
}
return '';
}
_correctDataRightBoundary: function (data, boundary, resolution) {
var lastDataPoint = data[data.length-1];
if (boundary > lastDataPoint.x) {
var nextPointInTime = moment.unix(lastDataPoint.x).add(1, resolution).unix();
if (nextPointInTime < boundary) {
data.push({"x": nextPointInTime, "y": 0});
}
data.push({"x": boundary, "y": 0});
}
}
};