added moment for parsing dates in profile timeline

fixed bug of duplicate penalties
fixed showing timeline date for non events
refresh player count on server overview
fix refresh privileged users on map load
fix 1h showing on tempban if manually specified
This commit is contained in:
RaidMax
2018-03-27 19:27:01 -05:00
parent a07ce112b0
commit 233aeeb12f
395 changed files with 191125 additions and 43 deletions

View File

@ -65,7 +65,6 @@ $(document).ready(function () {
$('.modal-body').append("Location &mdash; " + response["city"] + ", " + response["regionName"] + ", " + response["country"] + "<br/>");
$('#mainModal').modal();
});
});
/*
@ -127,11 +126,11 @@ function shouldIncludePlural(num) {
let mostRecentDate = 0;
let currentStepAmount = 0;
let lastStep = "";
let lastStep = '';
function timeStep(stepDifference) {
let hours = (stepDifference / (1000 * 60 * 60));
let days = (stepDifference / (1000 * 60 * 60 * 24));
let weeks = (stepDifference / (1000 * 60 * 60 * 24 * 7));
let hours = stepDifference / (1000 * 60 * 60);
let days = stepDifference / (1000 * 60 * 60 * 24);
let weeks = stepDifference / (1000 * 60 * 60 * 24 * 7);
if (Math.round(weeks) > Math.round(currentStepAmount / 24 * 7)) {
currentStepAmount = Math.round(weeks);
@ -151,15 +150,15 @@ function timeStep(stepDifference) {
function loadMeta(meta) {
let eventString = '';
const metaDate = Date.parse(meta.when);
const metaDate = moment.utc(meta.when).valueOf();
if (mostRecentDate === 0) {
mostRecentDate = metaDate;
}
const step = timeStep(new Date().getTime() - metaDate);
const step = timeStep(moment.utc().valueOf() - metaDate);
if (step !== lastStep) {
if (step !== lastStep && step !== undefined && metaDate > 0) {
$('#profile_events').append('<span class="p2 text-white profile-event-timestep"><span class="text-primary">&mdash;</span> ' + step + '</span>');
lastStep = step;
}

View File

@ -76,7 +76,8 @@ function refreshClientActivity() {
cache: false
})
.done(function (response) {
//const clientCount = $(response).find('.col-6 span').length;
const clientCount = $(response).find('.col-6 span').length;
$('#server_header_' + serverId + ' .server-clientcount').text(clientCount);
$('#server_clientactivity_' + serverId).html(response);
})
.fail(function (jqxhr, textStatus, error) {