Profiler/Completions

* removed old workaround for js date object creation
This commit is contained in:
Sarjuuk
2024-07-13 19:22:25 +02:00
parent a9f1832b6d
commit 99a95f3995
2 changed files with 3 additions and 4 deletions

View File

@@ -620,8 +620,8 @@ class AjaxProfile extends AjaxHandler
// titleId => 1
$profile['titles'] = DB::Aowow()->selectCol('SELECT `titleId` AS ARRAY_KEY, 1 FROM ?_profiler_completion_titles WHERE `id` = ?d', $pBase['id']);
// achievementId => date
$profile['achievements'] = DB::Aowow()->selectCol('SELECT `achievementId` AS ARRAY_KEY, `date` FROM ?_profiler_completion_achievements WHERE `id` = ?d', $pBase['id']);
// achievementId => js date object
$profile['achievements'] = DB::Aowow()->selectCol('SELECT `achievementId` AS ARRAY_KEY, CONCAT("$new Date(", `date` * 1000, ")") FROM ?_profiler_completion_achievements WHERE `id` = ?d', $pBase['id']);
// just points
$profile['achievementpoints'] = $profile['achievements'] ? DB::Aowow()->selectCell('SELECT SUM(`points`) FROM ?_achievement WHERE `id` IN (?a)', array_keys($profile['achievements'])) : 0;

View File

@@ -7573,8 +7573,7 @@ function ProfilerCompletion(_parent) {
}
if ((!_opt.compute || _opt.compute(row, data[i])) && data[i]) {
// row.completed = (data[i].getTime ? data[i] : (_opt.showQuantity ? data[i] : 1)); // aowow: idk a way to generate a jScript-TimeObject in php (there probably isn't), but one is expected here
row.completed = (data[i] > 946681200 ? new Date(data[i] * 1000) : (_opt.showQuantity ? data[i] : 1)); // so we create a dateObject from data[i] if it is a unixtime past the 1.1.2000 - 0:00 (wich probably isn't used as a sensible int anyway)
row.completed = (data[i].getTime ? data[i] : (_opt.showQuantity ? data[i] : 1));
hasData = true;
}
else {