diff --git a/includes/ajaxHandler/profile.class.php b/includes/ajaxHandler/profile.class.php index 57f36e07..4e90a835 100644 --- a/includes/ajaxHandler/profile.class.php +++ b/includes/ajaxHandler/profile.class.php @@ -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; diff --git a/static/js/Profiler.js b/static/js/Profiler.js index 8ae3f8e9..68e69217 100644 --- a/static/js/Profiler.js +++ b/static/js/Profiler.js @@ -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 {